Computer Networks Lecture #10 PDF

Document Details

CuteWatermelonTourmaline

Uploaded by CuteWatermelonTourmaline

Kangwon National University

Tags

computer networks networking computer science protocols

Summary

This document is a lecture on computer networks, focusing on concepts like MAC addresses, ARP, Ethernet, switches, and VLANS. The lecture details how these components function in data transmission and network design.

Full Transcript

Computer Networks Lecture #10 In the last lecture Introduction to the Link layer and LANs Error detection, correction Multiple access protocols Today LANs Addressing, Address Resolution Protocol (ARP) Ethernet Switches VLANs Addressing, Address Resolution Protocol (ARP) MAC a...

Computer Networks Lecture #10 In the last lecture Introduction to the Link layer and LANs Error detection, correction Multiple access protocols Today LANs Addressing, Address Resolution Protocol (ARP) Ethernet Switches VLANs Addressing, Address Resolution Protocol (ARP) MAC address 32-bit IP address (128-bit address in IPv6) Network layer address assigned to each interface Used for layer 3 forwarding e.g., 143.70.234.100 48-bit MAC address (Also called LAN or physical or Ethernet address) Used “locally” to get frames from one interface to another physically-connected interface (same subnet in IP-addressing sense) Burned in NIC ROM, also sometimes software settable e.g., 1A-2F-BB-76-09-AD (Hexa decimal notation, each numeral represents 4 bits) MAC address Each interface on LAN Has a unique 48-bit MAC address Has a locally unique 32-bit IP address (as we’ve seen) MAC address MAC address allocation administered by IEEE Manufacturer buys portion of MAC address space (to ensure uniqueness) MAC address is at Advantageous for portability Can move an interface from one LAN to another c.f.) IP address is not portable - depends on IP subnet to which a node is attached Analogy MAC address - social security number, IP address - postal address fl Why do we need MAC address? Theoretically, a network could be built only using IP address alone Practically, We do not have an approach that gives an unique IP address to each node Someone assigns IP address to his/her machine, manually Two or more people can have receive the message at the same time Due to the laying architecture, we need MAC If MAC address is not used, L2 layer passes through any data frame it receives, directly to the network layer Address Resolution Protocol (ARP) Question) We generally send messages with the destination IP address (DNS returns IP address, not MAC address). Then, how can MAC address be obtained and used to deliver the message → address translation between IP address and MAC address * ARP table - Each IP node (host, router) on LAN has a table - IP/MAC address mapping for some LAN nodes - TTL (time to live) timer after which address mapping will be discarded (typically 20min.) ARP protocol in action e.g., A wants to send a datagram to B B’s MAC address is not in A’s ARP table, so A uses ARP to nd B’s MAC address fi ARP protocol in action e.g., A wants to send a datagram to B B’s MAC address is not in A’s ARP table, so A uses ARP to nd B’s MAC address fi ARP protocol in action e.g., A wants to send a datagram to B B’s MAC address is not in A’s ARP table, so A uses ARP to nd B’s MAC address fi Routing to another subnet Sending a datagram from A to B via R Focus on addressing at IP (datagram) and MAC layer (frame) levels Assume that A knows B’s IP address A knows IP address of the rst hop router, R (how?) A knows R’s MAC address (how?) fi Routing to another subnet A creates an IP datagram with IP source A, destination B A creates a link-layer frame containing A-to-B IP datagram R’s MAC address is the frame’s destination Routing to another subnet The frame is sent from A to R The frame is received at R, datagram removed, passed up to IP Routing to another subnet R determines an outgoing interface, passes the datagram with IP source A, destination B to the link layer Routing to another subnet R determines an outgoing interface, passes the datagram with IP source A, destination B to the link layer R creates a link layer frame containing A-to-B IP datagram. The frame destination address would be B’s MAC address →Transmit link layer frame Routing to another subnet B receives a frame, extracts an IP datagram destined to B B passes the datagram up to IP protocol stack Ethernet Ethernet Dominant wired LAN technology First widely used LAN technology Simple, cheap Kept up with speed race (10Mbps - 400Gbps) Single chip, multiple speeds (e.g., Broadcom BCM 5761) Physical topology of Ethernet Bus Popular through mid 90s All nodes in the same collision domain (can collide with each other) Switched Prevails today Active link-layer (layer 2) switch in center Each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other) Ethernet frame structure Sending interface encapsulates IP datagram (or other network layer protocol packet) * Preamble - Used to synchronize receiver and sender clock rates - 7 bytes of 10101010 followed by one byte of 10101011 (SFD) Ethernet frame structure Sending interface encapsulates IP datagram (or other network layer protocol packet) * Addresses - 6 byte source and destination MAC addresses - If an adapter receives a frame with matching destination address, or with broadcast address (e.g., ARP packet), it passes data in the frame to network layer protocol. Otherwise, it discards the frame. Ethernet frame structure Sending interface encapsulates IP datagram (or other network layer protocol packet) * Type - Indicates higher layer protocol - Mostly IP but others possible, e.g., Novell IPX AppleTalk - Used to demultiplex up at the receiver Ethernet frame structure Sending interface encapsulates IP datagram (or other network layer protocol packet) * FCS - Cyclic redundancy check at the receiver - If errors are detected, a frame is dropped Ethernet: unreliable, connectionless Connectionless: no handshaking between sending and receiving NICs Unreliable: receiving NIC doesn’t send ACKs or NAKs to sending NIC Data in dropped frames are recovered only if the initial sender uses higher layer RDT (e.g., TCP). Otherwise, dropped data is lost Ethernet’s MAC protocol: unspotted CSMA/CD with binary backo ff IEEE 802.3 Ethernet standards: link & physical layers Many di erent Ethernet standards Common MAC protocol and frame format Di erent speeds: 2Mbps, 10Mbps, 100Mbps, 1Gbps, 10Gbps, 40Gbps Di erent physical layer media: ber, cable ff ff ff fi Switches Ethernet switch A link-layer device that takes an active role Stores, forwards Ethernet frames Examines incoming a frame’s MAC address, selectively forward the frame to one or more outgoing links When the frame is to be forwarded on segment, CSMA/CD is used to access segment Transparent: hosts unaware of presence of switches Plug-and-play, self-learning Switches do not need to be con gured fi c.f.) store-and-forward vs. cut-through Store-and-forward Frame has to be received entirely before a forwarding decision is made Cut-through Makes a forwarding decision as soon as it gets the destination MAC address of the frame (needs only the rst 6 bytes) fi Switch: multiple simultaneous transmissions Hosts have dedicated, direct connection to switch Switches bu er packets Ethernet protocol used on each incoming link No collision; full duplex Each link is its own collision domain Switching A-to-A’ and B-to-B’ can transmit simultaneously, without collisions ff Switch: multiple simultaneous transmissions Hosts have dedicated, direct connection to switch Switches bu er packets Ethernet protocol used on each incoming link No collision; full duplex Each link is its own collision domain Switching A-to-A’ and B-to-B’ can transmit simultaneously, without collisions ! but A-to-A’ and C-to-A’ can not happen simultaneously ff Switch forwarding table How does switch know A’ reachable via interface 4, B’ reachable via interface 5? ⇒ each switch has a switch table, each entry: - (MAC address of a host, interface to reach the host, time stamp) - looks like a routing table! How are entries created, maintained in switch table? ⇒ something like a routing table? Switch: self-learning Switch learns which hosts can be reached through which interfaces When a frame is received, switch “learns” the location of a sender: incoming LAN segment Records sender/location pair in switch table Switch: frame filtering/forwarding When a frame is received at switch record the incoming link, MAC address of the sending host look up the switch table using MAC destination address if entry is found for destination if the destination is on the segment from which the frame arrived → drop the frame else forward the frame on interface indicated by the entry else ood fl Self-learning, forwarding e.g., Frame destination: A’ (location unknown at the switch) ooding Interface toward A is learned at the switch fl Self-learning, forwarding e.g., Frame destination: A’ (location unknown at the switch) ooding Interface toward A is learned at the switch Frame Destination: A (location known at the switch) selectively send on just one link Interface toward the source (node A) is learned fl Interconnecting switches Self-learning switches can be connected together Sending from A to G - how does S1 know to forward the frame destined to G via S4 and S3? ⇒ self-learning! (works exactly the same as in a single-switch case Self-learning multi-switch example Suppose C sends frame to I, I responds to C Show switch tables and packet forwarding in S1, S2, S3, S4 Small institutional network Switches vs. Routers Both are store-and-forward routers: network-layer devices (examine network layer header) switches: link-layer devices (examine link layer header) Both have forwarding tables routers: compute table using routing algorithms, IP addresses switches: learning forwarding table using ooding, learning, MAC addresses fl VLANs Virtual LANs (VLANs): motivation What happens as LAN sizes scale? What if users want to change a point of attachment? Single broadcast domain Scaling: all layer-2 broadcast tra c (ARP, DHCP, unknown MAC) must cross entire LAN E ciency, security, privacy issues ffi ffi Virtual LANs (VLANs): motivation What happens as LAN sizes scale? What if users want to change a point of attachment? Single broadcast domain Scaling: all layer-2 broadcast tra c (ARP, DHCP, unknown MAC) must cross entire LAN E ciency, security, privacy issues Administrative issues CS user moves o ce to EE - physically attached to EE switch, but wants to remain logically attached to CS switch ffi ffi ffi Port-based VLANs Switch ports grouped by switch management software → each group corresponds to each virtual LAN Single physical switch can operates as multiple virtual switches Virtual Local Area Network (VLAN) switches supporting VLAN capabilities can be con gured to de ne multiple virtual LANs over a single physical LAN infrastructure fi fi Port-based VLANs Tra c isolation Frames to/from ports 1~8 can only reach ports 1~8 VLAN can also be de ned based on MAC addresses of endpoints, rather than switch port Dynamic membership Ports can be dynamically assigned among VLANs Forwarding between VLANs Done via routing (just as with separate switches) In practice, vendors sell combined switches plus routers ffi fi VLANs spanning multiple switches Trunk port carries frames between VLANs de ned over multiple physical switches Frames forwarded within VLAN between switches can’t be vanilla 802.1 frames (must carry VLAN ID info) 802.1q protocol adds/removed additional header elds for frames forwarded between trunk ports fi fi 802.11Q VLAN frame format 802.11Q VLAN frame format * PRI : 3bit priority indicator - larger value indicates higher priority - on congestion, packets with the highest priority is sent rst fi 802.11Q VLAN frame format * CFI : 1bit indicator - xed value of 0 on Ethernet - 0: MAC address is encapsulated in the standard format - 1: MAC address is encapsulated in the non-standard format fi Questions?

Use Quizgecko on...
Browser
Browser