ì Computer Networking

Transcription

ìComputer NetworkingCOMP 177 Fall 2020 University of the Pacific Jeff ShaferEthernet

2RecapPast Topicsì An overview of computernetworkingì WiresharkToday’s Topicsì Ethernetì Hubsì Switchesì Packet format in Ethernetì MAC addressesComputer NetworkingFall 2020

3Classic Ethernetì Ethernet is an IEEE standard for wired LANs - IEEE 802.3ì A data link layer protocol, proposed in 1970sì Initially was a bus topology for LANsì a long cable to which all devices are attached signal couldbe attenuatedì Solution: coaxial cable rather than twisted pair copperwire!Computer NetworkingFall 2020

4Classic EthernetìEach device is connected to the bus through a hardware componentcalled network interface controller (NIC)ìEach node in the LAN broadcasts its packet (called Ethernet frame) overthe busìAll NICs on a LAN can receive a transmitted packetìA NIC decides whether to send the received packet to the operatingsystem. How?ììììEthernet physical addresses are called MAC addressesìComputer NetworkingEach Ethernet packet includes physical address of the destination NICUpon receiving a packet, NIC checks whether that address matches its ownIf so, passes the packet to OS. Otherwise, drops it!Medium Access ControlFall 2020

5Classic EthernetOriginal picture drawn by Bob Metcalfe,inventor of Ethernet(1972 – Xerox PARC)Ether – 19th century name for mediaenabling the propagation of lightComputer NetworkingFall 2020

6Collision DetectionìBroadcasting packets in a shared medium, e.g., a bus, mayend in collisionìIf two packets collide, both transmissions failAnimation from ution: Carrier Sense, Multiple Access, with CollisionDetection (CSMA/CD)ìììComputer NetworkingBefore transmission, wait for the line to be quietWhile transmitting, monitor the lineIf collision detected, wait (“back off”), and then retransmitwhen quiet againFall 2020

7Ethernet: HubsìHubs are physical-layer devices that interconnect machines within aLANìWith the rise of hubs, the bus topology for LANs diminishedìHubs provided a cheaper solution for LANsì Twisted pair copper wire replacedcoaxial cableì Shorter distances with less attenuationì Cheaper 10BASE-T standardì 10 Mbps / Twisted PairìCollisions could still occur in hubsìCSMA/CD is used!Computer NetworkingFall 2020

8Ethernet: SwitchesìSwitches (aka bridges) have both physical and data link layersìSwitches process the incoming frame’s destination physicaladdressììThen, transmit the frame from thecorresponding egress portReduces collisions & performance hitof CSMA/CD in LANsìSwitched LANs use twisted paircopper wireìMoving from hubs to switchesis straightforwardComputer NetworkingFall 2020

9Ethernet StandardsComputer 2019-roadmap/Fall 2020

10Ethernet Frame Formatì An Ethernet frame consists of three componentsì Header, comprised of some fieldsì 112 bits longì Payload is the network layer packet, e.g., an IPdatagramì Up to 1500 bytes longì Trailer, comprises of a single Ethernet fieldì 32 bits longComputer NetworkingFall 2020

11Ethernet Frame Format: Headerì Ethernet header has three fields:ì Dest. MAC address (48 bits) – physical addr. of NIC in receiving hostì Source MAC address (48 bits) – physical addr. of NIC in sending hostì Type (16 bits) stores the upper layer protocol, i.e., the protocol used inthe Ethernet payloadì IPv4: 0x0800Computer NetworkingIPv6: 0x86DDARP: 0x0806Fall 2020

12Ethernet Frame Format: Payload, TrailerìEthernet frame payloadìììThe packet coming from upper layer, i.e., network layerPayload size was limited to 1500 bytes in 10 Mbps LANs dueto technological constraints1500 bytes became the de facto maximum network layerpacket size in the Internetì Jumbo Frames (non-standard): 9000 bytesìEthernet frame trailerìConsists of a single 32-bit field: Cyclic redundancy check(CRC)ì Computed based on the entire Ethernet frameì Used to identify bit flips (errors due to noise) during frametransmissionComputer NetworkingFall 2020

13Promiscuous Modeì By default upon receiving a frameì NIC reads the destination MAC address in frame headerì If that address matches NIC’s own address, then NICsends the frame payload to the upper layer processì Otherwise, discards the frameì Promiscuous mode:ì NIC accepts all frames!ì Independent of what the destination MAC address is, thepayload is passed to the upper layer processì Allows machine to sniff all of frames transmitted in a LANì Used for diagnostic purposes (e.g. Wireshark)Computer NetworkingFall 2020

14MAC AddressesìMAC addresses are 48 bits longìRepresented usually by sequence of 6 hex numbers separatedby colonììHigher 24 bits refer to manufacturer IDìììCalled Organizationally Unique Identifier (OUI)Managed by IEEELower 24 bits refer to the serial number of NICìComputer NetworkingExample: 08:00:27:A8:69:6CAssigned by manufacturer of NICFall 2020

15Broadcast & Multicast MAC Addressesì Broadcast MAC addressì 48 bits of 1: FF:FF:FF:FF:FF:FFì NIC accepts all frames with destination broadcast addressì Multicast MAC addressì To transmit packets to a predefined set of receiversì The host needs to register the multicast address in its NICì If NIC receives a frame with the already-registeredmulticast destination address, accepts itì Lowest bit in the first byte of addressì 0: physical (unicast) addressì 1: multicast addressComputer NetworkingFall 2020

16NIC and Destination MAC Addressì NIC accepts an Ethernet frame according to itsdestination MAC ifì Destination MAC address is the same as NIC’s MACaddress, orì Destination MAC address is broadcast MAC address,orì Destination MAC address is an already-registeredmulticast address, orì NIC is in promiscuous modeì Otherwise, the NIC drops the frameComputer NetworkingFall 2020

17Switch Forwarding Tableì A switch has multiple Ethernet interfacesì Upon receiving a frame, the switchì Examines the destination MAC address in the frame’s headerì Sends the packet through the appropriate Ethernet interface to thedevice with that destination MAC addressQuestion: How does aswitch identify the egressinterface?Answer: By maintaining aforwarding table!Computer NetworkingFall 2020

18Switch Forwarding Tableì A switch forwarding table mapsì The MAC address of a device connected to the switch, toì An Ethernet interface of that F:27:25int1int2int3int6Dest MAC:8C:85:90:4D:C8:02Computer Networkingint5int4Dest. 2int276:3D:AB:FF:27:25int3. Fall 2020

19Switch Forwarding Tableì Upon receiving a frame, the switchìExtracts the destination MAC address in the frame headerìSearches the forwarding table for a matchì Match found?ìSwitch forwards the frame through that interfaceì Match not found?Computer NetworkingìSwitch floods the frameìTransmitting the frame from every Ethernet interfaceexcept for the one the frame was received fromFall 2020

20Example: Switch Floodingì Consider this forwardingtable for a switch:Dest. 2int3ì How does the switch forward the frame in this 27:25int2int1int3int4Dest MAC:76:3D:AB:FF:27:25Computer NetworkingFall 2020

21Example: Switch Floodingì Answer: It FF:27:25int2int1int3int4Dest MAC:76:3D:AB:FF:27:25Computer NetworkingFall 2020

22Switch Forwarding Tableì A switch forwarding table on boot up is emptyì Switches do not need manual configuration of theirforwarding tablesì Question: How is a switch forwarding table populated?ì Answer: A switch gradually learns about the topology ofthe network and populates the tableììComputer NetworkingThe switch maintains a per-interface list of all source MACaddresses receivedAssumption: If a frame destined to that MAC addressappears, it must be reachable through that interfaceFall 2020

23Example: Populating SwitchForwarding TableììConsider the followingforwarding table for a switchDest. 2int3How does the switch forwarding table change upon receiving the packet inthe following 27:25int2int37A:B5:42:87:9A:B2int1Src MAC:7A:B5:42:87:9A:B2Computer NetworkingDest MAC:76:3D:AB:FF:27:25int4Dest. 2int37A:B5:42:87:9A:B2Fall 2020int1

24Example: Switch Forwarding TablesìConsider the following LANììììAssume that initially all forwarding tables are emptyA sends a frame to BB responds to AHow are the forwarding tables are updated in each switch?How do switches forward these two frames?Computer NetworkingFall 2020

25Closing ThoughtsRecapì Today we discussedìEthernet protocol in datalink layer with differentstandardsìMAC addresses and theirstructureìHubs and switchesìHow switches do frameforwardingComputer NetworkingNext Classì WiFi (802.11)Class ActivityCA.2 – Ethernet & WiresharkDue tonight at 11:59pmFall 2020

Collision Detection ì Broadcasting packets in a shared medium, e.g., a bus, may end in collision ì If two packets collide, both transmissions fail ì Solution: Carrier Sense, Multiple Access, with Collision Detection(CSMA/CD) ì Before transmission, wait for the line to be quiet ì While transmitting, monitor the line ì If collision detected, wait ("back off"), and then retransmit