CIT 384: Network AdministrationSlide #1 CIT 384: Network Administration IP
CIT 384: Network AdministrationSlide #2 Topics 1.Network Layer 2.IP Packets 3.IP Addresses 4.Subnets 5.IP Routing 6.ARP and DHCP
CIT 384: Network AdministrationSlide #3 Routing The primary function of the network layer is routing. IP is the widely used network layer protocol. IP routing relies on the structure of IP addresses.
CIT 384: Network AdministrationSlide #4 Routing Logic PC1: If host on same Ethernet, send; otherwise, send to gateway router. R1, R2: Lookup destination in route table and forward packet to specified router. R3: Lookup destination in route table and send to local Ethernet.
CIT 384: Network AdministrationSlide #5 Network Layer Interaction with Data Link Layer PC1: Network layer encapsulates data in Ethernet frame. R1: Extract IP packet from Ethernet frame, and encapsulate in HDLC frame to send to R2. R2: Extract IP packet from HDLC frame and encapsulate in FR frame. R3: Extract IP packet from FR frame and encapsulate in Ethernet frame.
CIT 384: Network AdministrationSlide #6 IP Packet Header
CIT 384: Network AdministrationSlide #7 IP Header Protocol version: IPv4 Header length: bit words Type of service (TOS): –3-bit precedence (ignored today) –4 TOS bits (min delay (telnet), max throughput (ftp), max reliability, min monetary cost) –unused 0 bit
CIT 384: Network AdministrationSlide #8 IP Header Total length: length of IP datagram (bytes) –maximum size: bytes –large packets fragmented at data link layer. –small packets may be padded to minimum length. TTL: upper limit on number of router hops. Protocol: which protocol supplied packet data. Header checksum: IP header checksum
CIT 384: Network AdministrationSlide #9 IP Fragments IP packets may be fragmented by routers for transmission across different media. –Max IP packet size: –Max Ethernet packet size: 1500 IP headers contain fragment data: –Don’t Fragment Flag: 0=allowed, 1=don’t –More Fragments Flag: 0=last, 1=more fragments –Identification: identifies single packet for reassembly. –Fragment Offset: where contents of fragment go.
CIT 384: Network AdministrationSlide #10 IP Addresses 32-bit integers One for each network interface. Dotted decimal notation: ii.jj.kk.ll byte 32 bits = 4 bytes
CIT 384: Network AdministrationSlide #11 Grouping IP Addresses Groups of consecutive IP addrs are called networks. Routing table would only need 3 entries below.
CIT 384: Network AdministrationSlide #12 Network and Host Parts IP addresses are divided into two parts –Network ID (like zip code) –Host ID (like street address) Network IDHost ID Two special IP addresses –Network address (e.g ) –Broadcast address (e.g )
CIT 384: Network AdministrationSlide #13 Address Classes Class A: bit net ID, 24-bit host ID 2 24 – 2 hosts per network; 126 networks Class B: bit net ID, 16-bit host ID 2 16 – 2 hosts per network; 16,384 networks Class C: bit net ID, 8-bit host ID (2 8 – 2) = 254 hosts per network; 2,097,152 networks Class D: bit multicast group ID Class E: Reserved for future use
CIT 384: Network AdministrationSlide #14
CIT 384: Network AdministrationSlide #15 Assigning Addresses ICANN assigns network numbers. –Internet Corporation for Assigned Network Numbers. –ICANN gives authority to regional orgs, e.g. ARIN (American Registry for Internet Numbers) –Typically to ISPs, universities, corporations. ISP assigns IP addresses within network
CIT 384: Network AdministrationSlide #16 Addressing without Subnetting
CIT 384: Network AdministrationSlide #17 Why do we need subnets? Non-subnet design requires –6 class B address spaces. –Each class B has 65,534 IP addresses Even if we assume many more PCs exist, some networks are drastically underutilized. –150.6 only has 2 IP addresses (routers)
CIT 384: Network AdministrationSlide #18 Addressing with Subnets
CIT 384: Network AdministrationSlide #19 IP Addresses with Subnets Route on network + subnet part of address.
CIT 384: Network AdministrationSlide #20 IP Routing
CIT 384: Network AdministrationSlide #21 Host Routing 1.If destination IP address on same subnet, send the packet directly to dest. 2.Otherwise, send packet to default gateway router.
CIT 384: Network AdministrationSlide #22 Router Logic 1.Check data-link FCS field for errors. Discard packet if an error detected. 2.Extract IP packet and discard data link header and trailer. 3.Compare packet’s destination IP address with routing table, and find route that matches the address. This route identifies the outgoing interface of router. 4.Encapsulate IP packet inside a new data link header and trailer appropriate for outgoing interface, and forward the frame.
CIT 384: Network AdministrationSlide #23 Routing Example PC1 sending a packet to PC2. 1.PC1 to R1. 2.R1 to R2. 3.R2 to R3. 4.R3 to PC2.
CIT 384: Network AdministrationSlide #24 Routing Example
CIT 384: Network AdministrationSlide #25 Routing Table Where to send an IP packet to? Use a table lookup: routing table Search Process: 1.Search for a matching host address. 2.Search for a matching network address. 3.Search for a default route. No route to destination: Host or network unreachable error if search fails.
CIT 384: Network AdministrationSlide #26 Routing Table st361m13 ( ) > netstat –rn Routing Table: IPv4 Destination Gateway Flags Ref Use Int U hme U 1 0 hme0 default UG UH lo0
CIT 384: Network AdministrationSlide #27 Routing Table Destination: final destination host/network Gateway: next host in route to destination Flags U: Route is up G: Route is to a gateway (router) H: Route destination is a host (not a network) D: Route created by a redirect M: Route modified by a redirect
CIT 384: Network AdministrationSlide #28 Routing Table direct access to local subnet multicast route default forward packets to router at IP loopback
CIT 384: Network AdministrationSlide #29 Routing Table Sources Manual (static) routes Added with the route command. ICMP redirects can alter routes Router sends ICMP redirect when packet should’ve been sent to another router. Routing protocols Routers exchange routes with each other using special routing protocols. Full internet router tables contain ~30,000 routes. Source routing Sender includes routing info in packet header.
CIT 384: Network AdministrationSlide #30 IP Routing Protocol Goals 1.Dynamically learn and fill routing table with a route to all subnets in network. 2.If more than one route available, place the best route in the routing table. 3.Replace lost routes with the best available route as soon as possible. 4.Prevent routing loops.
CIT 384: Network AdministrationSlide #31 Routing Protocol Procedure 1.Add a route to table for each directly connected subnet. 2.Tell neighbors about all routes in its routing table, including both directly connected routes and routes learned from other routers. 3.After learning a new route from neighbor, add that route to the table.
CIT 384: Network AdministrationSlide #32 Routing Protocol Example 1.R3 learns directly connected subnet to E0. 2.R3 sends update to R2, so R2 adds. 3.R2 sends update to R1, so R1 adds route for with outgoing interface of S0, the interface it learned from.
CIT 384: Network AdministrationSlide #33 Address Translation: DNS and ARP Hannah wants to send packet to Jessie, but doesn’t know destination IP or MAC addrs. Solution: address translation Jessie to IP address via DNS IP address to MAC address via ARP
CIT 384: Network AdministrationSlide #34 DNS Domain Name Service Translates names to IP addresses and vice-versa.
CIT 384: Network AdministrationSlide #35 ARP Address Resolution Protocol 1.Broadcast request for MAC address for dest IP. 2.Owner of dest IP replies with MAC address. 3.Cache address so don’t have to ARP for every packet.
CIT 384: Network AdministrationSlide #36 ARP Example sftp zappa.nku.edu 1.Obtains IP address from DNS. 2. sftp asks TCP to connect to IP address 3.TCP sends connection request to zappa using an IP datagram 4.Sending host emits ARP broadcast, asking for MAC address of given IP address 5.Destination host’s ARP layer receives broadcast, answers with an ARP reply w/ IP->MAC mapping 6.Sending host constructs Ethernet frame with destination MAC address containing IP datagram 7.Sending host sends IP datagram
CIT 384: Network AdministrationSlide #37 ARP Cache st361m13 ( ) > arp -a Net to Media Table: IPv4 Device IP Address Phys Addr hme0 at_elan.lc3net 00:00:a2:cb:28:5e hme :e0:cf:00:0e:92 hme0 st361m13 08:00:20:d8:e0:07 hme :90:27:b6:b5:e5 hme :e0:cf:00:15:bd
CIT 384: Network AdministrationSlide #38 ARP Features Proxy ARP –Router can answer ARP requests on network B for a host on network A with its own MAC address since host A cannot see broadcast and B cannot send directly to A. Gratuitous ARP –Host sends ARP for own IP address at boot. –No reply should be received. –Network misconfiguration if reply received.
CIT 384: Network AdministrationSlide #39 DHCP Dynamic Host Configuration Protocol provides: IP address Netmask Gateway router DNS servers
CIT 384: Network AdministrationSlide #40 ICMP (Internet Control Message Protocol) Network layer protocol encapsulated in IP –Communicates error messages and exceptions. –Messages handled by either IP or TCP/UDP. IP Header (20 bytes)ICMP Message 8-bit type8-bit code16-bit checksum Contents (always depend contains on type and code IP header + 8 data bytes)
CIT 384: Network AdministrationSlide #41 ICMP Message Types Type 0: echo (ping) reply Type 3: destination unreachable Type 4: source quench Type 5: redirect Type 8: echo (ping) request Type 9, 10: router advertisement, solicitation Type 11: time (TTL) exceeded Type 12: parameter (header) problem Type 13: timestamp Type 14: timestamp reply Type 15, 16: information request, reply
CIT 384: Network AdministrationSlide #42 References 1.James Boney, Cisco IOS in a Nutshell, 2 nd edition, O’Reilly, Cisco, Cisco Connection Documentation, Cisco, Internetworking Basics, c/introint.htm 4.Wendell Odom, CCNA Official Exam Certification Library, 3 rd edition, Cisco Press, Priscilla Oppenheimer and Joseph Bardwell, Troubleshooting Campus Networks, Addison-Wesley, W. Richard Stevens, TCP/IP Illustrated, Addison-Wesley, 1994.