【正文】
of Computer Science amp。 Technology 70 3. Dynamic Host Configuration Protocol ?DHCP is a Client/Server protocol ?The client is typically a newly arriving host wanting to obtain work configuration information ?each sub will have a DHCP server at least. ?runs over UDP ?plug and play LinkLayer Addressing School of Computer Science amp。 Technology 71 ?Operation ?server discovery msg. ?Dest. IP:, Source IP: ?Dest. MAC:FFFFFFFFFFFF ?server offer msg. ?DHCP offer msg. including IP address, Sub Mask, Address lease time, DNS Server, Default Gateway/Router, etc. ?DHCP request msg. ?choose one from multiple offers, may be e from different DHCP servers ?DHCP ACK msg. ?server ack. 3. Dynamic Host Configuration Protocol LinkLayer Addressing School of Computer Science amp。 Technology 72 3. Dynamic Host Configuration Protocol LinkLayer Addressing UDP Port Number School of Computer Science amp。 Technology 73 Roadmap ? Link Layer: Introduction and Services ? ErrorDetection and Correction ? Multiple Access Protocols ? LinkLayer Addressing ? Ether ? Hubs and Switches ? PPP ? Link Virtualization: ATM and MPLS School of Computer Science amp。 Technology 74 Introduction “ dominant” wired LAN technology: ? cheap $20 for 100Mbs! ? first widely used LAN technology ? Simpler, cheaper than token LANs and ATM ? Kept up with speed race: 10 Mbps – 10 Gbps Metcalfe’s Ether sketch Ethernet School of Computer Science amp。 Technology 75 ?Bus topology popular through mid 90s ?Now star topology prevails ?Connection choices: hub or switch (more later) hub or switch Introduction Ethernet School of Computer Science amp。 Technology 76 1. Ether Frame Structure Sending adapter encapsulates IP datagram (or other work layer protocol packet) in Ether frame Preamble(8 bytes): ?7 bytes with pattern 10101010 followed by one byte with pattern 10101011 ? used to synchronize receiver, sender clock rates Ethernet School of Computer Science amp。 Technology 77 ?Addresses: 6 bytes ?matching destination MAC address, or with broadcast address (eg ARP packet), to layer protocol ?otherwise, adapter discards frame ?Type: ?indicates the higher layer protocol (mostly IP but Novell IPX and AppleTalk) ?CRC: ?checked at receiver, if error is detected, the frame is simply dropped Ethernet 1. Ether Frame Structure School of Computer Science amp。 Technology 78 Manchester Encoding Ethernet School of Computer Science amp。 Technology 79 Unreliable and connectionless service ?Connectionless ?no handshaking between sending and receiving adapter. ?Unreliable ?receiving adapter doesn’t send ACKs/NAKs to the sending adapter ?stream of datagrams passed to work layer can have gaps ?gaps will be filled if app is using TCP ?otherwise, app will see the gaps Ethernet School of Computer Science amp。 Technology 80 2. Ether uses CSMA/CD (P460) ?No slots ?adapter doesn?t transmit if it senses that some other adapter is transmitting, that is, carrier sense ?transmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detection ?Before attempting a retransmission, adapter waits a random time, that is, random access Ethernet School of Computer Science amp。 Technology 81 2. Ether?s CSMA/CD (P461) 1. Adapter receives datagram from layer amp。 creates frame 2. If an adapter senses channel idle, it starts to transmit frame. If it senses channel busy, waits until channel idle and then transmits.(96bit times) 3. If adapter transmits entire frame without detecting another transmission, the adapter is done with frame ! 4. If adapter detects another transmission while transmitting, aborts and sends jam signal(48bit stream) 5. After aborting, adapter enters exponential backoff: after the mth collision, adapter chooses a K at random from {0,1,2,…,2m1}. Adapter waits K?512 bit times and returns to Step 2 Ethernet School of Computer Science amp。 Technology 82 2. Ether?s CSMA/CD (P461462) Exponential Backoff: ?Goal: ?adapt retransmission attempts to estimated current load ?heavy load: random wait will be longer ?first collision: choose K from {0,1}。 ?after second collision: choose K from {0,1,2,3}… ?after tenth or more collisions, choose K from {0,1,2,3,4,…,1023} ?delay is K*512 bittime Ethernet School of Computer Science amp。 Technology 83 2. Ether?s CSMA/CD ?Bit time: ?1 microsec for 10 Mbps Ether ?for K=1023, wait time is about 50 msec ?Jam Signal: ?make sure all other transmitters are aware of collision。 48 bits Ethernet School of Computer Science amp。 Technology 84 CSMA/CD Example ?Ether網(wǎng)絡(luò)中的 只有 兩個(gè)節(jié)點(diǎn) A和 B活動(dòng),相距 225bittime。假設(shè) A和 B同時(shí)發(fā)送 Frame造成沖突,并且 A和 B選擇不同的 K值退后重傳。兩節(jié)點(diǎn)重傳的 Frame會(huì)不會(huì)再一次 造成沖突? ?t=0時(shí), A和 B同時(shí)開(kāi)始發(fā)送 Frame ?t=225bittime時(shí)兩者均檢測(cè)到?jīng)_突 ?A和 B在 t=225+48= 273bittime結(jié)束傳輸 jam信號(hào) ?假設(shè) KA=0, KB=1 ?何時(shí) A開(kāi)始重傳? ?何時(shí) A重傳信號(hào)到達(dá) B? ?何時(shí) B計(jì)劃開(kāi)始重傳? ?B計(jì)劃的重傳會(huì)不會(huì)延后進(jìn)行? Ethernet School of Computer Science amp。 Technology 85 CSMA/CD Example (contd…) Ethernet 時(shí)間 t (bittime) 事 件 0 A和 B均開(kāi)始發(fā)送 Frame 225 A和 B均檢測(cè)到?jīng)_突 225+ 48= 273 A和 B結(jié)束傳輸 Jam信號(hào) 273+225 = 498 498+ 96 = 594 B的最后一位 Jam信道到達(dá) A A檢測(cè)到信道空閑 273+512 = 785 785+ 96 = 881 B計(jì)劃重新偵測(cè)信道是否空閑 B計(jì)劃開(kāi)始重傳 Frame 594+225 = 819 881819 A重傳 Frame的第一位到達(dá) B B將自己的重傳計(jì)劃推后進(jìn)行 School of Computer Science amp。 Technology 87 Roadmap ? Link Layer: Introduction and Services ? ErrorDetection and Correction ? Multiple Access Protocols ? LinkLayer Addressing ? Ether ? Hubs and Switches ? PPP ? Link Virtualization: ATM and MPLS School of Computer Science amp。 Technology