Upload
marlene-johnson
View
216
Download
2
Embed Size (px)
Citation preview
Operating SystemsOperating Systems
Lesson 10
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
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
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)
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
Transmission modesTransmission modes
BroadcastMulticast
Unicast
TCP/IP protocol stackTCP/IP protocol stack
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
Ethernet: StarEthernet: Star
HUB: Connect devices as a single segment
Switch: Inspect and forward packets to appropriate port
Ethernet: CSMA/CDEthernet: CSMA/CD
CSMA/CACSMA/CA
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
IP RoutingIP Routing
network id
costnext hop
........ ........ ........
........ ........ ........
Windows shell: ROUTE PRINT
If Destination Address & Mask==Network Idsend to specified gateway through
specified NIC
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
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
IP is Best-Offer: IP is Best-Offer: Fault-events
◦data corruption ◦lost data packets ◦duplicate arrival ◦out-of-order packet delivery
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
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
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
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
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