ARP, IP Chong-Kwon Kim Routing Within a LAN MAC Address Each station (or network interface) should be uniquely identified Use 6 byte long address Broadcast & Filter Broadcast medium Signals are transmitted to all stations A B C D X Y Suppose B X B specifies X s address in a frame All stations receive the frame, but only X filters in the frame 2
Interconnection Devices Extended LAN = Broadcast domain The Internet Provides world-wide end-to-end connections Need to Inter-connect many small networks H H B H H Router Router H H LAN = MAC domain Application Inter-connection devices Application Transport Network Data Link Physical Gateway Router Bridge/Switch Repeater Transport Network Data Link Physical Interconnection Device - Repeater Repeater Physical layer device that restores and relays signals Hub Multiport repeater + Fault detection & recovery Limitations of repeater Single Collision Domain Collision domain Physical limitations Ethernet 2500 meter max. distance
Interconnection Device - Bridge Bridge Store and forward: relay frames if needed according to the MAC protocol Extended LAN Propagate MAC multicast/broadcast frames Bridge manages filtering DB a b c d e f g h i Switch (layer 2) Multiport bridge with parallel paths Bridge - Routing Bridge maintains routing information Questions 1. How to obtain the routing Information? 2. What if a node migrate to other network? 3. What mechanism to use to maintain the information? 6
STP Loop Bridge floods frames Unknown destinations Multicast/Broadcast Build a virtual tree Spanning Tree Protocol 7 Interconnection Devices Router & Others Router Network layer device Does not propagate MAC multicast Layer N switch Gateway Transport & upper layer devices 8
Network Layer Functions Construction of a logical network connecting multiple physical networks internetwork, internet End-to-end packet delivery Layer 4~N Network Layer 1/2 Logical Network (internetwork, internet) Physical Network Router (Gateway) -Routing - Arbitrate difference between two physical networks IP Packet Delivery Model Design Goal: Be FLEXIBLE enough to work with any underlying network technologies. Datagram (not Virtual Circuit) No connection setup (Read Textbook, Section 3.1) Best-effort (no guarantee) Lost packets Out-of-order delivery Packet duplication Delayed delivery IP works on any hardware (phy. Network) technologies IP over X
IP Address Each Internet host has a universally unique IP address Format 4 bytes Hierarchical Network ID & Host ID Net ID Each (physical) network has a unique network ID Assign unique host IDs to the hosts within the same (physical) network Host ID IP address Notation Binary - 11000000 00000101 00110000 00000011 Dotted decimal - 192.5.48.3 IP Address Classes One network ID is allocated to an physical network In reality: A network ID is allocated to an organization or to an AS with many physical networks 0 Net ID Host ID 1 0 Net ID Host ID 1 1 0 Net ID Host ID 1 1 1 0 Multicast Address Class A Class B Class C Class D Class Range (First Byte) A 0-127 B 128-191 C 192-223 D 224-239 E 240-255
Special IP Addresses All-0s This host All-1s All hosts on this net Limited broadcast All-0 host suffix Network address All-1 host suffix All hosts in the specified net Directed broadcast 127.*.*.* Loopback through IP layer IP Addressing All hosts on a same physical network have the same network ID(prefix) 147.46.0.3 147.46.0.0 147.46.a.b 147.47.c.d 147.47.0.0 147.47.0.3 147.46.214.5 10.0.0.0 How about the host(router) w/ more than one interfaces? 10.10.0.7 10.0.64.1 192.5.48.0 192.5.48.24
Internetworking with Routers A Ethernet X Y Point-topoint Z B Ethernet FDDI Flight of a packet from A to B A TCP X Y Z B TCP IP IP IP IP IP ETH ETH FDDI FDDI P2P P2P ETH ETH IP Routing (Forwarding) Direct and Indirect delivery Direct: Source & destination are in the same physical network Indirect: Source & destination are on different physical networks Case 1: Host a --> Host b Host a knows that host b is in the same physical network How? Case 2: Host a --> Host c Host a relay datagram to router A or B 10.0.0.1 a 10.0.0.5 b 10.0.0.0 A 20.0.0.0 B E C 30.0.0.0 D 40.0.0.0 F 50.0.0.0 c 40.0.0.5 d 50.0.0.1
Forwarding Table - 1 Routers (Hosts also) manage directives called Forwarding Table that shows best routes to destinations To reduce the forwarding table size (scalability), route based on networks, not hosts Hop by hop forwarding A forwarding table indicates the very next hop router on the path To destination (Learn Source Routing) Forwarding Table - 2 Format <Destination ID, next hop> Usually, destination ID is the network ID 10.0.0.1 a 10.0.0.5 b 10.0.0.0 A 20.0.0.0 B E C 30.0.0.0 D 40.0.0.0 F 50.0.0.0 c 40.0.0.5 d 50.0.0.1 Forwarding table at host a Dest. 10.0.0.0 20.0.0.0 30.0.0.0 40.0.0.0 50.0.0.0 Next hop Direct Delivery Router B Router A Router B Router A IP address of Router B s interface to a network 10.0.0.0 18
Forwarding Table - 3 Further size reduction Default route Forwarding table at host a Search sequence is important List specific routes first Search from top to bottom How to look at your forwarding table? netstat command Dest. 10.0.0.0 20.0.0.0 30.0.0.0 40.0.0.0 50.0.0.0 Dest. 10.0.0.0 20.0.0.0 40.0.0.0 Default Next hop Direct Delivery Router B Router A Router B Router A Next hop Direct Delivery Router B Router B Router A 19 Forwarding Table - 4 Host s forwarding table is simple Default route (Most hosts are connected to an edge network) Routers have more entries Some have > 10 entries 10.0.0.5 10.0.0.1 a b 10.0.0.0 A B C 30.0.0.0 20.0.0.0 D E 40.0.0.0 50.0.0.0 F c 40.0.0.5 Forwarding table at router C Dest. 20.0.0.0 30.0.0.0 10.0.0.0 40.0.0.0 50.0.0.0 Next hop Direct Delivery Direct Delivery Router B Router E Router SNU INC D lab. d 50.0.0.1 20
Physical/Logical Network interaction Host a sends a datagram to Host c using the following path a 20.0.0.3 20.0.0.5 = 389 = 300 10.0.0.0 B 20.0.0.0 E 40.0.0.0 10.0.0.1 10.0.0.4 40.0.0.1 40.0.0.5 = 077 = 104 = 548 = 731 End-to-end delivery over a logical network is realized by - Repetitive hardware-level forwarding within a series of physical networks - Network layer forwarding at intermediate routers c DA SA DA SA Payload From host a to router B MAC DA = 104 MAC SA = 077 IP DA = 40.0.0.5 IP SA = 10.0.01 IP Header Format SNU INC lab.
IP Datagram Format TTL (Time To Live) In hop count Remove bad packets Header checksum 1 s complement sum of all 16-bit words in the header The link speed of today s fast routers: Tbps Should process > pkts/sec Fast path & slow path As an IP datagram moves around the Internet, TTL is counted down by one at each router. How do you update the checksum field? Should we check error at each router? Fragmentation & Reassembly MTU (Maximum Transfer Unit) Maximum IP datagram size that a physical network can transmit Different physical networks have different MTUs Ethernet - 1500 Byte 802.11g 2300 Byte, FDDI - 4500 Byte S Ethernet R Router Router 8000 Byte
Fragmentation & Reassembly Fragmentation Partitioning of a datagram into multiple smaller fragments Sizes <= MTU of next physical network Reassembly Concatenation of fragments into the original datagram Protocol principle Fragmentation & Reassembly S R1 R2 R MTU = 2000 MTU = 820 MTU = 2000 Original = 2000 Byte Fragments = 820 Byte Fragments = 400 Byte Information for reassembly ID Offset Total length Flag Where to perform reassembly? Router OR Destination? Any security issues??
ARP (Address Resolution protocol) Problem Each host has two different addresses Physical address (Hardware address, MAC address) Logical address (Protocol address, IP address) Same physical network A C B E D F Assumption: Every host knows its own logical & Physical addresses Suppose A wants to send a packet to C How to know C s physical address? ARP Basic Use an ARP table that maps IP address MAC address IP address MAC address 197.15.3.1 0A:4B:00:00:07:08 197.15.3.2 0B:4B:00:00:07:00 197.15.3.3 0A:5B:00:01:01:03 197.15.3.4 04:06:07:08:09:10 197.15.3.5 06:07:09:08:03:01 Who manages the table? Note that IP address and MAC address bindings may change dynamically
ARP Two Methods Two types of network Broadcast network: LANs (Ethernet, Token ring, ) NBMA (Non-Broadcast Multiple Access) Example: ATM, X.25 Two AR approaches Distributed Each host builds the mapping table Collect mapping information asking to targets Centralized A specialized server maintains the table Usually, each host periodically reports its own mapping information to the servers ARP - Distributed Broadcast Network A B C D E Suppose host A wants to resolve host C s address Host A broadcasts a request packet How would you assure C receives the request? Physical broadcast All hosts receive the request, but only C will respond. How? How to design the protocol?
ARP Packet Format IP-Ethernet HW Type Protocol Type HLEN PLEN Operation Sender HA (Octets 0-3) Sender HA (octets 4,5) Sender IP (Octet 0,1) Sender IP (octets 2,3) Target HA (Octet 0,1) Target HA (Octets 2-5) Target IP (Octets 0-3) Request packet Response packet DA SA SIP SHA TIP THA DA SA SIP SHA TIP THA ARP Enhancements ARP cache Store mapping information in an ARP cache for later uses When to remove cache entries? After timeout e.g. 5 min Improvements All hosts refresh the sender s info. in their cache The target adds the sender s mapping in its cache How to look at your ARP table? arp command
ARP Variations Proxy ARP A server (usually a router) may act as a proxy for others IP addresses Gratuitous ARP (GARP) 33 Reverse ARP (RARP) & DHCP A host may not know its IP address Knows its hardware address Problem in general What is the IP address of a host with the given h/w address? RARP server RARP, designed for diskless clients, is seldom used now But, RARP has been evolved to RARP BOOTP DHCP(Dynamic Host Configuration Protocol) Static IP address & Dynamic IP Ease of management: Automatic configuration Efficient use of addresses: Assign address only when needed
DHCP To join the Internet, a host needs Unique IP address+ subnet mask Forwarding table Default router DNS server DHCP A protocol to auto-configure hosts DHCP server has A pool of available IP addresses Default routers & DNS server info. IP Addresses? MAC addresses? 35 DHCP Packet Format Refer to: http://support.microsoft.com/kb/169289/ko http://en.wikipedia.org/wiki/dynamic_host_configuration_protocol Operation HType HLen Hops Secs Xid ciaddr yiaddr siaddr giaddr chaddr (16 bytes) Flags sname (64 bytes) file (128 bytes) SNU options INC lab. 36
DHCP Relay DHCP server for each network Management overhead Relay Unicast to server Broadcast DHCP relay Other networks DHCP server Host 37