CS162 Operating Systems and Systems Programming Lecture 22 Networking II April 13 2010 Ion Stoica http inst eecs berkeley edu cs162 Multiple Access Algorithm Single shared broadcast channel Avoid having multiple nodes speaking at once Otherwise collisions lead to garbled data Multiple access mechanism Distributed algorithm for sharing the channel Algorithm determines which node can transmit Classes of techniques Channel partitioning divide channel into pieces Taking turns scheme for trading off who gets to transmit Random access allow collisions and then recover Optimizes for the common case of only one sender 4 13 10 CS162 UCB Spring 2010 Lec 22 2 Random Access Protocol AlohaNet Norm Abramson left Stanford in search of surfing Set up first radio based data communication system connecting the Hawaiian islands Hub at Alohanet HQ Univ Hawaii Oahu Other sites spread among the islands Had two radio channels Random access sites sent data on this channel Broadcast only used by hub to rebroadcast incoming data 4 13 10 CS162 UCB Spring 2010 Lec 22 3 Aloha Transmission Strategy When new data arrived at site send to hub for transmission Site listened to broadcast channel If it heard data repeated knew transmission was rec d If it didn t hear data correctly it assumed a collision If collision site waited random delay before retransmitting Problem Stability what if load increases More collisions less gets through more resent more load More collisions Unfortunately some sender may have started in clear get scrambled without finishing 4 13 10 CS162 UCB Spring 2010 Lec 22 4 Ethernet Bob Metcalfe Xerox PARC visits Hawaii and gets an idea Shared medium coax cable Can sense carrier to see if other nodes are broadcasting at the same time Sensing is subject to time lag Only detect those sending a short while before Monitor channel to detect collisions Once sending can tell if anyone else is sending too 4 13 10 CS162 UCB Spring 2010 Lec 22 5 Ethernet s CSMA CD CSMA Carrier Sense Multiple Access CD Collision detection Sense channel if idle If detect another transmission Abort send jam signal Delay and try again Else Send frame Receiver accepts Frames addressed to its own address Frames addressed to the broadcast address broadcast Frames addressed to a multicast address if it was instructed to listen to that address All frames promiscuous mode 4 13 10 CS162 UCB Spring 2010 Lec 22 6 Ethernet s CSMA CD more Exponential back off Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longer First collision choose K from 0 1 delay is K x 512 bit transmission times After second collision choose K from 0 1 2 3 After ten or more collisions choose K from 0 1 2 3 4 1023 Minimum packet size Give a host enough time to detect collisions In Ethernet minimum packet size 64 bytes What is the relationship between minimum packet size and the length of the LAN 4 13 10 CS162 UCB Spring 2010 Lec 22 7 Minimum Packet Size more Host 1 a Time t Host 1 starts to send frame b Time t d Host 2 starts to send a frame ust before it hears from host 1 s frame c Time t 2 d Host 1 hears Host 2 s frame detects collision Host 2 propagation delay d Host 1 Host 2 propagation delay d Host 1 Host 2 propagation delay d d LAN length ligh speed min frame size 2 bandwidth LAN length min frame size light speed 2 bandwidth 8 64b 2 5 108mps 2 107 bps 6400m approx What about 100 mbps 1 gbps 10 gbps 4 13 10 CS162 UCB Spring 2010 Lec 22 8 Goals for Today Networking Network layer Transport layer start MapReduce primer project 4 4 13 10 CS162 UCB Spring 2010 Lec 22 9 Review Point to point networks Router Internet Switch Point to point network a network in which every physical wire is connected to only two computers Switch a bridge that transforms a shared bus broadcast configuration into a point to point network Hub a multiport device that acts like a repeater broadcasting from each input to every output Router a device that acts as a junction between two networks to transfer data packets among them 4 13 10 CS162 UCB Spring 2010 Lec 22 10 Network IP Layer Deliver a packet to specified network destination Packet forwarding routing Perform segmentation reassemble Others packet scheduling buffer management Packet forwarding the process of selecting outgoing link next hop to forward a packet Usually done based on destination address Routing the process of computing paths between end points and building forwarding tables at routers 4 13 10 CS162 UCB Spring 2010 Lec 22 11 IP Routing Each packet is routed individually like a letter Packets of same connection may take different paths Host C Host D Host A router 1 router 2 router 3 router 5 Host B router 6 router 7 Host E router 4 4 13 10 CS162 UCB Spring 2010 Lec 22 12 IP Routing Each packet is routed individually like a letter Packets of same connection may take different paths Host C Host D Host A router 1 router 2 router 3 router 5 Host B router 6 router 7 Host E router 4 4 13 10 CS162 UCB Spring 2010 Lec 22 13 Packet Forwarding IP v4 addresses 32b Quad notation bytes separated by dots x don t care Internet At each router the packet destination address 1 Is matched according to longest prefix matching rule 2 Packet is forwarded to the corresponding output port Forwarding table 128 15 xxx xxx 3 128 15 11 xxx 2 16 82 100 xxx 2 Router data 16 25 31 10 128 15 11 12 1 2 source destination address address 4 13 10 interconnection backplane CS162 UCB Spring 2010 interfaces Lec 22 14 Internet Routing Two Level Hierarchy Autonomous system AS network owned by one admin entity e g ATT Comcast Intra domain routing within an AS e g link state distance vector protocols Inter domain use across ASes Border Gateway Protocol BGP Interior router BGP router AS 1 AS 3 AS 2 4 13 10 CS162 UCB Spring 2010 Lec 22 15 Administrivia I ll be away Wednesday Friday Eurosys Thursday s lecture will be taught by Ben No office hour on Thursday April 15 Matei and Andy will be away as well Ben will teach the discussion sections of both Matei and Andy No office hours for Andy and Matei next week Project 4 Initial design Wednesday 4 21 will give you two discussion sections before deadline Code deadline Wednesday 5 5 two weeks later 4 13 10 CS162 UCB Spring 2010 Lec 22 16 Transport Layer Demultiplex packets at the receiver decide to which process to deliver a packet Others Flow control protocol to avoid over running a slow receiver Congestion control protocol to avoid over running congesting the network
View Full Document
Unlocking...