You are on page 1of 42

Chapter 5 Network Layer

CIS 81 Networking Fundamentals Rick Graziani Cabrillo College graziani@cabrillo.edu Spring 2010

This Presentation
 For a copy of this presentation and access to my web site for other CCNA, CCNP, and Wireless resources please email me for a username and password.  Email: graziani@cabrillo.edu  Web Site: www.cabrillo.edu/~rgraziani

2

Note
 This presentation is not in the order of the book or online curriculum.  This presentation also contains information beyond the curriculum.

3

Network Layer Overview

Network Layer IPv4 5 .

0 4-bit Version 4-bit Header Length 8-bit Type Of Service (TOS) 15 16 16-bit Total Length (in bytes) 3-bit Flags 31 16-bit Identification 13-bit Fragment Offset IP Header 8 bit Time To Live TTL 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Data Application Header + data 6 .

IP IP IP IP 7 .

Focus on Transport Layer IP IP 8 .

 Layer 3 uses four basic processes:  Addressing  Encapsulation  Routing  Decapsulation 9 .0 4-bit Version 4-bit Header Length 8-bit Type Of Service (TOS) 15 16 16-bit Total Length (in bytes) 3-bit Flags 31 Network Layer 16-bit Identification 13-bit Fragment Offset 8 bit Time To Live TTL 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Data  The Network layer (Layer 3) provides services to exchange the data over the network between identified end devices.

16.168.99 Source IP = 192.3.168.16.3.3.99  What would be the Source IP Address and Destination IP Address of a Packet from the client to the server?  What would be the Source IP Address and Destination IP Address of a Packet from the server to the client?  More later! 0 4-bit Version 4-bit Header Length 8-bit Type Of Service (TOS) 15 16 16-bit Total Length (in bytes) 3-bit Flags 31 16-bit Identification 13-bit Fragment Offset 8 bit Time To Live TTL 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Data 10 .99 Destination IP = 172.10 172.16.10 Source IP = 172.100.10 Destination IP = 192.168.100.Addressing 192.100.

Encapsulation and Decapsulation Data Link Header IP Header TCP Header HTTP Header Data Data Link Trailer Data Link Header IP Packet Data Link Trailer Data Link Header IP Packet Data Link Trailer Data Link Header IP Packet Data Link Trailer Data Link Header IP Header TCP Header HTTP Header Data Data Link Trailer 11 .

 Destination address examined. 12 .  If the address is correct segment is passed up to the appropriate service at Transport layer.Decapsulation Is the Destination IP Address of this packet my IP Address? Destination  Arrival packet processed at Layer 3.

3.16.  Search their routing tables.10 172.10  Routers examine Layer 3 Destination IP addresses to forward packets.168.100.100.99 Destination IP = 172.168.99 Source IP = 192.16.  Send the packet to the next-hop router or host if on that network 13 .3.0 4-bit Version 4-bit Header Length 8-bit Type Of Service (TOS) 15 16 16-bit Total Length (in bytes) 3-bit Flags 31 Routing 16-bit Identification 13-bit Fragment Offset 8 bit Time To Live TTL 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Data 192.

Network Layer Protocols  The Internet Protocol (IPv4 and IPv6) is the most widely-used Layer 3 data carrying protocol and will be the focus of this course. 14 .

IPv4 basic characteristics… 15 .

 Which layer 4 protocol on the sending host will not establish a connection?  UDP: A connectionless protocol. 16 .Connectionless  IP does not notify the destination host.  Which layer 4 protocol on the sending host will establish a connection?  TCP: A connection-oriented protocol.

undelivered or corrupt packets.Best Effort Service (unreliable)  Layer 3 (IP)  Speed over reliability  Unreliable: Does not have the capability or responsibility to manage.  Who does?  TCP at the end-to-end hosts 17 . and recover from.

18 .Media Independent  Responsibility of the OSI Data Link layer to take an IP packet and prepare it for transmission over the communications medium.  Transport of IP packets is not limited to any particular medium.  May need to fragment the packet if it is too many bits (later).

IP Header Where I came from. 19 .  IP Destination Address  32-bit binary value that represents the packet destination Network layer host address.  IP Source Address  32-bit binary value that represents the packet source Network layer host address. Where I am going.

 Common operating system TTL values are:  UNIX: 255  Linux: 64 or 255 depending upon vendor and version  Microsoft Windows 95: 32  Microsoft Vista: 128 20 .IP’s TTL – Time To Live field  Sending hosts generates the value for TTL.

IP’s TTL – Time To Live field Decrement by 1. 21 .  Decremented by each router. it will then drop the packet.  If the router decrements the TTL field to 0. if 0 drop the packet.  What is the advantage to decrementing the TTL by each router and dropping the packet if it is 0?  So IP packets can not travel around the Internet forever. from router to router.

 Example values are:  01 ICMP  06 TCP  17 UDP 22 .IP’s Protocol Field Protocol = 06 TCP  Protocol field enables the Network layer to pass the data to the appropriate upper-layer protocol.

 What types of traffic might a network administrator need to give priority to? Traffic that cannot accept any delays.  Enables Quality-of-Service (QoS) mechanism for high priority traffic.  VoIP  Streaming video 23 .IP’s ToS Field  Type-of-Service is used to determine the priority of each packet.

IP Fragmentation TCP MSS defines the maximum size of the data in the TCP segment. 1500 bytes Determining TCP MTU  The default Ethernet MTU value for a PC is 1500 bytes. How much is enough? 24 . TCP MSS = 1460 Data = 1460 bytes The host using Ethernet.  The number of bytes of data. MTU of 1500 octets so I will set my MSS to 1460. 20 bytes 20 bytes 1460 bytes Ethernet MTU defines the maximum size of the data in the Ethernet frame. (curriculum says MSS)  Typical Maximum Segment Size (MSS) of a TCP segment is 1460 bytes.

25 .  If Don’t Fragment flag set. but discard it.IP Fragmentation Original IP Packet IP IP Header = 20 bytes Data = 1480 bytes Data = 500 Data = 500 Data = 480 Data = 520 Data = 520 Data = 500 L2 L2 L2 This packet is too big to go over my serial link all at once. I need to break it into smaller fragments IP IP Packet Fragments IP IP L2 L2 L2  A router may have to fragment a packet when forwarding it from one medium to another medium that has a smaller MTU. it will not fragment packet.

IP Packet It is my job to reconstruct the packets.IP Fragmentation The outgoing link has a The outgoing link has a large enough MTU but I smaller MTU so I have to don’t reconstruct fragment the packets. packets. it does not get reconstructed until it reaches the host. IP Packet IP Packet IP Packet IP Packet Network link with larger MTU Network link with smaller MTU Network link with larger MTU IP Packet IP Packet IP Packet IP Packet IP Packet IP Packet  When fragmentation occurs.  This takes processing time.  Fragment Offset field identifies the order 26 .

but is important)  RFC 1191 (RFC1191)  Path MTU Discovery and Filtering ICMP Marc Slemko  Link on CIS 81 web page 27 .Path MTU Discovery Path MTU Discovery (Not discussed here.

Other IPv4 fields  Version . in bytes.Specifies the size of the packet header. including header and data.This field gives the entire packet size. 28 .There is provision for additional fields in the IPv4 header to provide other services but these are rarely used.This field is primarily used for uniquely identifying fragments of an original IP packet  Header Checksum .Contains the IP version number (4)  Header Length (IHL) .  Identification .The checksum field is used for error checking the packet header.  Options .  Packet Length .

Host and Network Addresses .

39/16 172.40. which will be discussed later.16.10.40.55/16 172.16.20.10.Network Address 172.123/16 172.40.16.16.103/16 172.16.16.  Note: Intermediary devices such as a switch may have an IP address to allow the network administrator to Telnet to the device for remote management.10/16 172.30.1/16 172.16.0.1.16.16.16.16.100/16 172.77/16 172.10.30.29/16  Host IP addresses are IP addresses assigned to end devices such as:  Client computers  Server computers  Network Printers  Router interfaces  Note: the /16 refers to the subnet mask.16.16.111/16 172.20.3/16 172.96/16 172.20.16.0/16 172. 30 .IP Addresses – First look Kiwi Airliners .30.51/16 172.

16.40.29/16  Host IP addresses are members of a group of addresses call the Network Address  IANA (Internet Assigned Numbers Authority) have the responsibility to allocate network addresses.16.96/16 172.20.30.0/16 172.100/16 172.16.30.16.16.16.16.16.16.  More detail in the next chapter.3/16 172.20.1.55/16 172.30.111/16 172.10.103/16 172.0. 31 .IP Addresses – First look Kiwi Airliners .16.40.20.10/16 172.77/16 172.1/16 172.51/16 172.16.Network Address 172.16.10.  A company or individual needing a network addresses typically goes to their ISP  ISPs then allocate network addresses to their customers.10.16.16.40.123/16 172.39/16 172.

 Host IP address on the same network as the host.2/30 192.1.0 172.100/16 Network Address 192.10.1/30 172.0.  This is a host IP address on the router.1.16.55/16 172.1/16 172.1.16.0/30 ISP Internet 192.10.168.16.16.10.  The host only has to be aware of:  Its own network address  Default gateway IP address to reach all devices outside its own network 32 .16.1.168.3/16  Host IP Address  Unique host IP address  Default Gateway  A router which is used to forward packets out of the network.IP Addresses – First look Network Address 172.168.

16.1 172.1.16.1.1/30 172.1 Network Address 192.16.1.1.1.0 172.1  All hosts in the same network will typically have the same default gateway IP address.10.0/30 ISP Internet 192.10.1.100/16 Gateway: 172.1. 33 .168.1/16 172.16.16.16.55/16 Gateway: 172.16.168.IP Addresses – First look Network Address 172.3/16 Gateway: 172.168.0.2/30 192.16.10.

1.0. . . . . . : 172. .16.255.16. . . . . 34 . .0. .100 Subnet Mask .0 Default Gateway . .100 Bcast:172.1. . : 255.8 Mb) TX bytes:2870928587 (2737. .10. . : IP Address. Default Gateway C:\> ipconfig Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix .0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2472694671 errors:1 dropped:0 overruns:0 frame:0 TX packets:44641779 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1761467179 (1679. . . . . .9 Mb) Interrupt:28 Linux: netstat –rn for default gateway information. . : 172.255. .16. . . .1 Root# ifconfig eth0 Link encap:Ethernet HWaddr 00:0F:20:CF:8B:42 inet addr:172.16. .255. .Confirming IP Address.255 Mask:255. .

Network Address 172.100/24 172.30.1/24 172.20.1.10.10/24 172.40.16.1/24 172.  This provides for several benefits which we will discuss later.16.40.16.29/24 172.0.16.16.77/24 172.1/24 172.16.16.10.30.16.16.20.16.39/24 172.16.16.16.20.Subnets Kiwi Airliners .0/16 172.0/24 172.10.16.30.96/24 172.16.51/24 172.16.16.40.40.  Networks can be grouped based on factors that include:  Geographic location.10.123/24 172.1/24  Networks can be subdivided into subnets.16.0/24 172.16.55/24 172.40.30.111/24 172.16.3/24 172. Ownership 35 .10.16.16.30.1/24 172.20.0/24 172.0/24 172.103/24 172.20. Purpose.

A Quick Look at Routing .

168.Routing – First Look Network 192.168.168.1.168. FastEthernet0/1  Routers know about:  Directly connected networks (C):  Network addresses of its interfaces  Remote networks 37 .0/24 Network 192.2.0/24 is direction connected.0/24 192.254/24 C 192.1.2.

168.168.2.168.254/24 C 192.0/24 192.0/24 Network 192. FastEthernet0/1  Routers know about:  Directly connected networks (C):  Network addresses of its interfaces  When a router is configured with the IP address/mask on an interface the router knows that it has an interface which is part of that network.1. (coming) 38 .2.1.  This is just like a host that is configured with an IP address/mask.0/24 is direction connected.Routing – First Look Network 192.168.

Routing – First Look Network 192.0/24 192.254/24 C 192.1.2.1. FastEthernet0/1  Routers learn about remote networks using:  Static routes  Dynamic Routing Protocol (R = RIP)  Routes in a routing table have three main features:  Destination network  Next-hop  Metric 39 .168.0/24 Network 192.168.0/24 is direction connected.2.168.168.

FastEthernet0/1  Static routes  Manually entered by the administrator  Dynamic Routing protocols  Routers automatically learn about remote networks  Ex: RIP.0/24 Network 192.2. IS-IS.168.2.0/24 192.168.168. OSPF.1.1. EIGRP.Routing – First Look Network 192.254/24 C 192. BGP 40 .168.0/24 is direction connected.

 Usually only contains:  Its own network address (directly connected network)  Default gateway IP address  Hosts usually do not have remote networks in their routing tables 41 .Host Routing Table netstat –r or route print  Hosts also have a local routing table.

edu .Chapter 5 Network Layer CIS 81 Networking Fundamentals Rick Graziani Cabrillo College graziani@cabrillo.