24
Operating Systems Operating Systems Lesson 10

Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Embed Size (px)

Citation preview

Page 1: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Operating SystemsOperating Systems

Lesson 10

Page 2: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

NetworkingNetworkingCommunications protocol is the

set of standard rules for ◦Data representation◦Signaling◦Authentication ◦Error detection

Usually split into layers◦Higher layer protocols use services

from low level◦High layer protocols adds complexity◦Low-level protocols are usually unaware

of higher-layer payload content

Page 3: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

OSI ModelOSI ModelOSI Model

Data unit Layer Function

Hostlayers

Data

7. Application Network process to application

6. Presentation Data representation and encryption

5. Session Interhost communication

Segment 4. Transport End-to-end connections and reliability (TCP)

Medialayers

Packet/Datagram 3. NetworkPath determination and logical addressing

(IP)

Frame 2. Data link Physical addressing (MAC & LLC)

Bit 1. Physical Media, signal and binary transmission

Page 4: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Routing/SwitchingRouting/SwitchingUsually there is no direct

connection between every 2 devices (PC, phones- hosts)

Communications data travels a path of several nodes( e.g routers/switches)

Each node forwarded (routes) data to the next node over a communication link(hop)

Page 5: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Packet vs. Circuit Packet vs. Circuit switchingswitchingPacket switching

◦Packets (discrete blocks of data) are routed between nodes over data links shared with other traffic

◦Usually “ best effort”Circuits switching

◦Establishes a fixed bandwidth circuit (or channel) between nodes and terminals before the users may communicate

◦Bandwidth is reserved even if data is not transmitted

Page 6: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Transmission modesTransmission modes

BroadcastMulticast

Unicast

Page 7: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

TCP/IP protocol stackTCP/IP protocol stack

Page 8: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Ethernet: BusEthernet: Bus

A network card, network adapter, LAN Adapter or NIC

•Several Stations connected by wire (bus), “everyone sees everyone” •Each station has unique address (MAC) burned into network card

•Need to know each other address to communicate

•Nothing is guaranteed

Page 9: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦
Page 10: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Ethernet: StarEthernet: Star

HUB: Connect devices as a single segment

Switch: Inspect and forward packets to appropriate port

Page 11: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Ethernet: CSMA/CDEthernet: CSMA/CD

Page 12: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦
Page 13: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

CSMA/CACSMA/CA

Page 14: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

IP addressIP addressNumerical address (115.64.32.12-

human readable form)

Global unique addresses to be reached from outside world

Local addresses to use within the enterprise can be reused by different networks

Host with local addresses can reach global hosts using Network Address Translation (NAT) mechanism

Page 15: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

IP RoutingIP Routing

network id

costnext hop

........ ........ ........

........ ........ ........

Windows shell: ROUTE PRINT

If Destination Address & Mask==Network Idsend to specified gateway through

specified NIC

Page 16: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

ARP (Address Resolution ARP (Address Resolution Protocol)Protocol) IP router decided what is the next hop

according to its routing table

Knows IP but Ethernet needs MAC address

Broadcast IP and wait for response from host that has this IP

ARP –a in windows shell

Page 17: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

DHCP (Dynamic Host DHCP (Dynamic Host Configuration Protocol)Configuration Protocol)What happens when you plug-in

network cable into wall?Your PC need to know its IP, IP of

a gateway and other parametersDHCP server accept broadcasts DHCP server assigns IP and

provides addresses of all required services

IPCONFIG in Windows Shell

Page 18: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

IP is Best-Offer: IP is Best-Offer: Fault-events

◦data corruption ◦lost data packets ◦duplicate arrival ◦out-of-order packet delivery

Page 19: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

UDP over IP (User UDP over IP (User Datagram)Datagram)Over IPPorts to distinguish applications

at the same hostNo guaranteed deliveryMay arrive out of order (different

routing path)LightWeight (less delay,

processing)

Usage: Audio streaming

Page 20: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

TCP over IP (TCP/IP)TCP over IP (TCP/IP)Transmission Control Protocol

(TCP)

Guaranteed delivery◦Packets have sequence number (SQN)◦Receiver send acknowledge (ACK)

Port number in addition to IP address◦To distinguish between applications

Mechanisms for establishment and termination of a connection

Page 21: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦
Page 22: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

DNS (Dynamic Name DNS (Dynamic Name System)System)Sometimes want to assign

symbolic name to a host (tau.ac.il) DNS server lookup IP address by

DNS nameMultilevel lookup (ac.il is an

address of DNS server which manage universities)

DNS server is obtained by DHCPDNS tables are cached everywhere

Page 23: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

Windows Networking Windows Networking ToolsTools IPCONFIG

◦ IP configuration ARP –a

◦ ARP table ROUTE PRINT

◦ IP routing table PING www.microsoft.com

◦ Ping host and DNS resolve TRACERT www.microsoft.com

◦ Routing path to host NSLOOKUP www.microsoft.com

◦ DNS lookup NETSTAT

◦ Open TCP/UDP ports

Page 24: Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦

ExampleExample Connect a laptop to the wall socket (Ethernet),

open browser and go to www.google.com 1. laptop detects that cable is connected2. Laptop broadcasts DHCP request asking for IP configuration (e.g. IP

address, IP routing table, DNS server address etc.)

3. DHCP server responses with IP configuration

4. Browser needs to translate symbolic address (google.com) to the numeric IP through sending a UDP request to DNS server

5. DNS server address is known (received through DHCP), need to know next gateway to reach it over IP

6. Lookup next gateway on the route to DNS using IP routing table

7. Got IP of the next gateway from IP table, need MAC address to send over Ethernet

8. Send ARP broadcast to find out MAC address of the gateway, save response in the table. Send DNS UDP request to the gateway through Ethernet.

9. After DNS server responds with IP of the Google’s web site, browser establishes TCP connection to port 80(HTTP) of the server

10. Repeat steps 6-8 this type for Google IP: Find next gateway on the way to Google web site, send ARP if required to find gateway’s MAC address