navigating the data through the network. – The function of the network layer is to find the best path through the network – The network layer's addressing scheme is used by devices to determine the destination of data as it moves through the network Layer 3 – Network Layer • Network layer is responsible for moving data through a set of networks (internetworks) • Protocols that have no network layer can only be used on small internal networks • The network layer use a hierarchical addressing scheme that allows for unique addresses across network boundaries • Also provides a method for finding a path for data to travel between networks Layer 3 – Segmentation • There are two primary reasons why multiple networks are necessary: – the growth in size of each network – the growth in the number of networks • network segments - break it up into smaller pieces; results in the network becoming a group of networks, each requiring a separate address Layer 3 – Devices • Routers are internetworking devices which operate at OSI Layer 3; pass data packets between networks based on Layer 3 information • Routers make logical decisions regarding the best path for the delivery of data on an internetwork and then direct packets to the appropriate output port and segment (Layer 3 switching) Layer 3 – Path Determination • Path Determination - enables a router to evaluate the available paths to a destination, and to establish the preferred handling of a packet • The router uses the network address to identify the destination network of a packet within an internetwork Layer 3 – Addressing • Hosts have two addresses: – MAC – Network • When you physically move a computer to a different network, the computer maintains the same MAC address, but you must assign it a new network address Layer 3 – Addressing • flat addressing scheme assigns a device the next available address (MAC) • Internet Protocol (IP) is the most popular implementation of a hierarchical network addressing Layer 3 – Addressing Layer 3 – Network layer fields • The IP packet consists of the data from upper layers plus an IP header, which consists of: – version - indicates the version of IP currently used (4 bits) – IP header length (HLEN) - indicates the datagram header length in 32 bit words (4 bits) – type-of-service - specifies the level of importance that has been assigned by a particular upper-layer protocol (8 bits) – total length - specifies the length of the entire IP packet, including data and header, in bytes (16 bits) Layer 3 – Network layer fields – identification - contains an integer that identifies the current datagram (16 bits) – flags - a 3-bit field in which the 2 low-order bits control fragmentation – one bit specifying whether the packet can be fragmented, and the second whether the packet is the last fragment in a series of fragmented packets (3 bits) – fragment offset - the field that is used to help piece together datagram fragments (13 bits) – time-to-live - maintains a counter that gradually decreases, by increments, to zero, at which point the datagram is discarded, keeping the packets from looping endlessly (8 bits) Layer 3 – Network layer fields – protocol - indicates which upper-layer protocol receives incoming packets after IP processing has been completed (8 bits) – header checksum - helps ensure IP header integrity (16 bits) – source address - specifies the sending node (32 bits) – destination address - specifies the receiving node (32 bits) – options - allows IP to support various options, such as security (variable length) – data - contains upper-layer information (variable length, maximum 64 Kb) – padding - extra zeros are added to this field to ensure that the IP header is always a multiple of 32 bits Layer 3 – IP Addresses
• IP address is represented by a 32 bit
binary number • IP addresses are expressed as dotted- decimal numbers - we break up the 32 bits of the address into four octets (an octet is a group of 8 bits). Layer 3 – IP Addresses • network number of an IP address identifies the network to which a device is attached • host portion of an IP address identifies the specific device on that network Layer 3 – IP Addresses • There are three classes of IP addresses that an organization can receive from the American Registry for Internet Numbers (ARIN) • Class A, B, and C – Class A addresses for governments throughout the world – Class B addresses for medium-sized companies – All other requestors are issued Class C addresses Layer 3 – IP Addresses • Class A – first (leftmost) bit of a Class A address is always 0 – which will range from 0-126 – use only the first 8 bits to identify the network part of the address ; remaining three octets can be used for the host portion of the address • Class B – first two bits (leftmost) of a Class B address is always 10 – which will range from 128-191 – Use the first 16 bits to identify the network part of the address ; remaining two octets can be used for the host portion of the address • Class C – first three bits (leftmost) of a Class C address is always 110 – which will range from 192-223 – use the first 24 bits to identify the network part of the address ; remaining octets can be used for the host portion of the address Layer 3 – IP Addresses Layer 3 – IP Addresses
• IP addresses are usually written in
dotted decimal notation Layer 3 – IP Addresses
• An IP address that ends with binary 0s
in all host bits is reserved for the network address (sometimes called the wire address) • If you wanted to send data to all of the devices on a network, you would need to use a broadcast address Layer 3 – Subnetting
• Network administrators sometimes
need to divide networks, especially large ones, into smaller networks – subnetworks/subnets • To create a subnet address, a network administrator borrows bits from the original host portion and designates them as the subnet field Layer 3 – Subnetting
• subnet mask - determines which part of
an IP address is the network field and which part is the host field • subnet mask is 32 bits long and has 4 octets, just like an IP address Layer 3 – Subnetting
• The Internet knows your network as a
whole, identified by the Class A, B, or C address, which defines 8, 16, or 24 routing bits (the network number) Layer 3 – Private Addresses