EEC484584 Computer Networks Lecture 14 Wenbing Zhao wenbingzgmail
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao wenbingz@gmail. com
Outline n Reminder q q q n n Lab#5: this Wednesday Quiz#4: 12/8 Wed Peer review due 12/6 Monday (EEC 584 only) ARP and DHCP Hubs and switches 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
Ethernet/MAC Addresses n Ethernet (or MAC or LAN or physical) address: q q Function: get frame from one interface to another physically-connected interface (same network) 48 bit MAC address n 9/25/2020 Burned in NIC ROM, also sometimes software settable EEC-484/584: Computer Networks 5 -3
MAC Addresses Each adapter on Ethernet has unique MAC address 1 A-2 F-BB-76 -09 -AD LAN (wired or wireless) 71 -65 -F 7 -2 B-08 -53 Broadcast address = FF-FF-FF-FF = adapter 58 -23 -D 7 -FA-20 -B 0 0 C-C 4 -11 -6 F-E 3 -98 9/25/2020 EEC-484/584: Computer Networks 5 -4
MAC Addresses n n n MAC address allocation administered by IEEE Manufacturer buys portion of MAC address space (to assure uniqueness) 32 -bit IP address: q network-layer address q used to get datagram to destination IP subnet MAC flat address ➜ portability q Can move LAN card from one LAN to another IP hierarchical address NOT portable q Address depends on IP subnet to which node is attached 9/25/2020 EEC-484/584: Computer Networks 5 -5
ARP: Address Resolution Protocol Question: how to determine MAC address of B knowing B’s IP address? n n 137. 196. 7. 78 1 A-2 F-BB-76 -09 -AD Each IP node (host, router) on LAN has ARP table: IP/MAC address mappings for some LAN nodes < IP address; MAC address; TTL> q 137. 196. 7. 23 137. 196. 7. 14 LAN 71 -65 -F 7 -2 B-08 -53 TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) 58 -23 -D 7 -FA-20 -B 0 0 C-C 4 -11 -6 F-E 3 -98 137. 196. 7. 88 9/25/2020 EEC-484/584: Computer Networks 5 -6
ARP Protocol: Same LAN n n n A wants to send datagram to B, and B’s MAC address not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address q Dest MAC address = FFFF-FF-FF q All machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address q 9/25/2020 n A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) q Soft state: information that times out (goes away) unless refreshed n ARP is “plug-and-play”: q Nodes create their ARP tables without intervention from net administrator Frame sent to A’s MAC address (unicast) EEC-484/584: Computer Networks 5 -7
Addressing: Routing to Another LAN Walkthrough: send datagram from A to B via R Assume A knows B’s IP address 88 -B 2 -2 F-54 -1 A-0 F 74 -29 -9 C-E 8 -FF-55 A 111 E 6 -E 9 -00 -17 -BB-4 B 1 A-23 -F 9 -CD-06 -9 B 222. 220 111. 112 R 222. 221 222 B 49 -BD-D 2 -C 7 -56 -2 A CC-49 -DE-D 0 -AB-7 D n Two ARP tables in router R, one for each IP network 9/25/2020 EEC-484/584: Computer Networks 5 -8
n n n n A creates IP datagram with source A, destination B A uses ARP to get R’s MAC address for 111. 110 A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram This is a really important A’s NIC sends frame example – make sure you R’s NIC receives frame understand! R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B’s MAC address R creates frame containing A-to-B IP datagram sends to B 88 -B 2 -2 F-54 -1 A-0 F 74 -29 -9 C-E 8 -FF-55 A E 6 -E 9 -00 -17 -BB-4 B 111 1 A-23 -F 9 -CD-06 -9 B 222. 220 111. 112 R 222. 221 222 B 49 -BD-D 2 -C 7 -56 -2 A CC-49 -DE-D 0 -AB-7 D 9/25/2020 EEC-484/584: Computer Networks 5 -9
ARP – Exercise n n Node 1 wants to send a packet to node 4, what will be returned by ARP? Node 1 wants to send a packet to node 2, what will be returned by ARP? 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
RARP – Reverse Address Resolution Protocol 32 -bit Internet address ARP RARP 48 -bit Ethernet address n RARP - Allows a newly-booted diskless-workstation (e. g. , X terminal) to broadcast its Ethernet address and ask for its IP address q RARP server responds to a RARP request with the assigned IP address 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
Limitations of RARP n n RARP uses a link-layer broadcast, RARP requests are not forwarded by routers, therefore, an RARP server must be present on every network The only thing returned by the RARP server is the IP address 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
BOOTP – Bootstrap Protocol n BOOTP – uses UDP q q q n BOOTP drawbacks q n A client broadcasts to 255 The source IP address is set to 0. 0 if client does not know its own IP address yet Port number: 67 for server, 68 for client Requires manual configuration of tables mapping IP address to Ethernet address at the BOOTP server Replaced by DHCP 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
Dynamic Host Configuration Protocol n Allow host to dynamically obtain its IP address from network server when it joins network q q n IP address assignment is lease-based (to cope with client failure, also enables reuse of addresses) Can renew its lease on address in use DHCP overview (UDP is used for communication) q q Host broadcasts “DHCP discover” msg DHCP server responds with “DHCP offer” msg Host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ack” msg 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
DHCP Replay n n A DHCP relay agent can be configured on each LAN The agent stores the IP address of the DHCP server and forward the request to the server 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
DHCP with Replay Agent n n n To find its IP address, a newly-booted machine broadcasts a DHCP Discover packet The DHCP relay agent on its LAN receives all DHCP broadcasts On receiving a DHCP Discover packet, the agent sends the packet as a unicast packet to the DHCP server, possibly on a distant network 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
Link Layer Devices n n Hubs Switches 9/25/2020 EEC-484/584: Computer Networks Wenbing Zhao
Hubs … physical-layer (“dumb”) repeaters: q Bits coming in one link go out all other links at same rate q All nodes connected to hub can collide with one another q No frame buffering q No CSMA/CD at hub: host NICs detect collisions twisted pair hub 9/25/2020 EEC-484/584: Computer Networks 5 -18
Switch n Link-layer device: smarter than hubs, take active role q q n Transparent q n Store, forward Ethernet frames Examine incoming frame’s MAC address, selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment, uses CSMA/CD to access segment Hosts are unaware of presence of switches Plug-and-play, self-learning q Switches do not need to be configured 9/25/2020 EEC-484/584: Computer Networks 5 -19
Switch: Allows Multiple Simultaneous Transmissions n n Hosts have dedicated, direct C’ connection to switch Switches buffer packets Ethernet protocol used on each incoming link, but no collisions; full duplex q Each link is its own collision domain Switching: a-to-a’ and b-to-b’ simultaneously, without collisions q Not possible with dumb hub 9/25/2020 A B 6 1 2 5 3 4 C B’ EEC-484/584: Computer Networks A’ switch with six interfaces (1, 2, 3, 4, 5, 6) 5 -20
Switch Table A n n Q: how does switch know that A’ C’ reachable via interface 4, B’ reachable via interface 5? A: each switch has a switch table, each entry: q (MAC address of host, interface to reach host, time stamp) Looks like a routing table! Q: how are entries created, maintained in switch table? q Something like a routing protocol? 9/25/2020 B 6 1 2 5 3 4 C B’ EEC-484/584: Computer Networks A’ switch with six interfaces (1, 2, 3, 4, 5, 6) 5 -21
Switch: Self-Learning Source: A Dest: A’ A A A’ n Switch learns which hosts can be reached through which interfaces q When frame received, switch “learns” location of sender: incoming LAN segment q Records sender/location pair in switch table C’ B 6 1 2 5 4 3 C B’ A’ Switch table (initially empty) 9/25/2020 EEC-484/584: Computer Networks 5 -22
Switch: Frame Filtering/Forwarding When frame received: 1. record link associated with sending host 2. index switch table using MAC dest address 3. if entry found for destination then { if dest on segment from which frame arrived then drop the frame else forward the frame on interface indicated } else flood forward on all but the interface on which the frame arrived 9/25/2020 EEC-484/584: Computer Networks 5 -23
Self-Learning, Forwarding: Example Source: A Dest: A’ A A A’ C’ n n B Frame destination unknown: flood Destination A location known: selective send A 6 A’ 1 2 4 5 C A’ A B’ 3 A’ Switch table (initially empty) 9/25/2020 EEC-484/584: Computer Networks 5 -24
Interconnecting Switches n Switches can be connected together S 4 S 1 S 3 S 2 A B C F D E I G H r Q: sending from A to G - how does S 1 know to forward frame destined to G via S 4 and S 3? r A: self learning! (works exactly the same as in singleswitch case!) 9/25/2020 EEC-484/584: Computer Networks 5 -25
Self-Learning Multi-Switch: Exercise Suppose C sends frame to I, I responds to C S 4 1 S 1 2 S 2 A B C S 3 F D E I G H Ø Q: show switch tables and packet forwarding in S 1, S 2, S 3, S 4 9/25/2020 EEC-484/584: Computer Networks 5 -26
Institutional Network 9/25/2020 EEC-484/584: Computer Networks 5 -27
Switches vs. Routers n n n Both store-and-forward devices q Routers: network layer devices (examine network layer headers) q Switches are link layer devices Routers maintain routing tables, implement routing algorithms Switches maintain switch tables, implement filtering, learning algorithms 9/25/2020 EEC-484/584: Computer Networks 5 -28
- Slides: 28