1/136
The network layer
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
network layer
Responsible for carrying a packet from one computer to another
Responsible for host-to-host delivery
Between Transport(gives services to) and Data Link (receives services from) layers
internetworking
Refers to the logical gluing of heterogeneous physical networks together to look like a single network to the upper transport and application layers
Source and destinations are usually referred to as hosts
A host/router is referred to as a hop
network layer at source
Receives data from the transport layer
Adds the universal addresses of sender and receiver
Makes sure the packet is of correct size for passage through the next link, fragments if necessary
network layer at router or switch
Responsible for routing the packet using a routing table
The packet may go through another fragmentation if need be
network layer at destination
Address verification, error detection, reassembling fragments
Delivering packet to the transport
addressing
Used to uniquely and universally identify each device on the internet to allow global communication between all device
multiple addresses
Each address belongs to a single host but a single host can have _________ _______ if it has multiple connections to the internet
internet/IP address
The identifier used in the network layer of the internet model is called
Is a 32-bit binary address (in IPv4)
Unique and universal (one host can have multiple IP addresses)
wastage
With IP addressing being 32-bits there are 2^32 possible hosts, assumed to be too many initially but now not sufficient due to a number of reasons, mainly ______
classful addressing
Address spacing is divided into 5 classes A-E
First few bits indicate the class of an address in binary/dotted-decimal notation
classes A-C
These classes are used for unicast communication
Hosts need to have at least one unicast address to be able to send and receive
class D
This class is used for multicast communication (only as a destination)
If a host belongs to a group/groups, It can have 1+ multicast addresses
class E
Is a reserved class
The idea behind this class was to use them for special purposes
netid and hostid
Address in classes A, B, and C are divided into _____(network) and _____(host) of varying length from class to class
problem with classful addressing
Each class is divided into a fixed number of block with each block having a fixed size
common IP address notations
Binary notation
Dotted-decimal notation
binary IP address notation
One or more spaces inserted between each octet
dotted-decimal IP address notation notation
More compact
Easier to read for humans
packetizing
Encapsulating packets received from upper-layer protocols and makes new packets out of them
Done by the IP protocol in the Internet model
fragmenting
Each router decapsulates the IP datagram from the received frame, processes it, and then encapsulates it in another frame
criteria for format and size for fragmenting
Received frame: Depends on the protocol used by the physical network from which the frame has just arrived
Departing frame: Depends on the protocol used by the physical network to which the frame is going
address resolution
Maps an IP address to a MAC address
network layer protocols
IP
ARP
RARP (DHCP)
ICMP
IGMP
IP protocol
Main protocol
Glue that holds the internet together
Responsible for host-to-host delivery
Needs the services of other protocols
reverse address resolution protocol
Maps a MAC address to an IP address
Gets used in situations like when a diskless host is booted
Gets binary image of its OS from a remote file server but doesn’t know its IP address
Obsolete (replaced by DHCP - Dynamic Host Configuration Protocol)
internet control message protocol
Handles unusual situations such as the occurrence of an error
internet group management protocol
Built for multicasting
Used by IP because IP is designed for unicast delivery
IPv4
Designed with internetworking in mind
Unreliable and connectionless datagram protocol
Only detects errors and discards corrupted packets
Paired with TCP for more reliability
IP datagram
Consists of a 20-byte header and a text part (optional part with variable length)
big endian order
IP datagrams are transmitted in this order
From left to right, with the high-order bit of the version field going first
SPARC is an example of this order
little endian
Software conversion is required on machines using this order
Pentium is an example of this order
version
4 bits
Keeps track of which version of the protocol the datagram belongs (for future transitions between new old versions)
IHL
Length of the header in 32-bit words
Minimum value is 5 when no options are present
Maximum is 15, which limits the header to 60 bytes (optional field to 40 bytes)
type of service
8 bits
Designed to distinguish between different classes of service - for various combination of reliability and speed
Mostly ignored by current routers
total length
16 bits
Describes size of everything in the data gram (header and data)
identification
16 bits
Used by the destination host to determine which datagram a newly arrived fragment belongs to
DF
1 bit
The destination is incapable of putting the pieces back together
All machines are required to accept fragments of 576 bytes or less
MF
1 bit
All fragments except the last one have this bit set to know when all fragments of a datagram have arrived
fragment offset
13 bits
Tells where in the current datagram this fragment belongs
All fragments except the last one must be a multiple of 8 bytes
A maximum of 8192(2^13) fragments per datagram allowed
Gives a maximum datagram length of 8×8192 bytes (2^16)
time to live
A counter used to limit packet lifetimes (max 255 seconds)
In practice, counts the number of hops
Set by source host
Approximately 2 times the max hops between any two hosts
Decremented on each hop
Decremented multiple times when queued for a long time in a router
When 0, is discarded and a warning packet is sent to the source host
protocol
8 bits
Identifies which transport process to give it to (TCP, UDP, ..)
header checksum
16 bits
Verifies header only
Sum of all fields is assumed to be zero upon arrival
Recomputed at each hop because at least one field always changes (Time to live)
options
Allow subsequent versions of the protocol to include information not present in the original design
Permit experimenters to try out new ideas
Avoid allocating header bits to information that is rarely needed
types of options
Security
Strict source routing
Loose source routing
Record route
Timestamp
security of options
For a router to specify not to route through certain countries
Ignored by all routers in practice
strict source routing of options
Gives the complete path from source to destination as a sequence of IP addresses
Useful for system managers to send emergency packets when routing tables are corrupted/making timing measurements
loose source rooting of options
Requires the packet to traverse the list of routers specified and order specified
May pass through other routers on the way
Most useful for when political/economic considerations dictate passing through/avoiding countries
record route of options
Tells the routers along the path to append their IP address to the option field
For system managers to track down bugs in routing algorithms
timestamp of optional header of IPv4
32-bit
Used for debugging routing algorithms
class a
Divided into 128 blocks with unique NetIds
Block 1 from 0.0.0.0 to 0.255.255.255 - NetId 0
Block 2 from 1.0.0.0 to 1.255.255.255 - NetId 0
Last block from 127.0.0.0 to 127.255.255.255 - NetId 126
These classes addresses were designed for large organizations (up to 16 million hosts (2^24)
network address
Given that an organization is granted a block from class A with a given netid “x”, the first address (x.0.0.0) is called the ________ _________ and is used to identify the organization
126
Total number of organization that can be assigned class A addresses
wastage of granting an organization a block of a class
the number of addresses in each block (16,777,214= 2^24-2) are larger than the needs of almost all organizations
class b
Divided into 2^14 blocks
Each block has a different NetId (second portion of the IP address)
16 blocks are reserved for private addresses (total number of organization that can be assigned this classes addresses is 16384 - 16
Designed for midsize organizations
Many addresses are wasted as there are more than the need of midsize organizations
class c
Divided into 2^21 blocks with each block having different NetId
Third portion of IP address
256 blocks used for private addresses(total number of organizations that can be assigned in this class is 2,097,152 -256)
Designed for small organizations
Limited blocks in this class - most organizations do not want a block in this class
class d
Only one block in this class designed for multicasting
class e
One block in this class designed for use as reserve addresses for research by the Internet Engineering Task Force to develop internet standards
network address
An address that defines the network itself
Cannot be assigned to a host
properties of network address
All hostid bytes are 0s; (different from a netid although this address has netid)
Defines the network to the rest of the Internet; routing to a host is based on this address
In classful addressing, the network address is the one that is assigned to the organization
internet corporation for assigned names and numbers
Manages network addresses to avoid conflicts
Nonprofit
Delegates parts of the address space to various regional authorities which in turn allocate IP addresses to ISPs and other companies
special IP addreses
An IP address with all 0s (hostid and/or netid) - means this is a host/network
An IP address with all 1s (netid and/or hostid) - means all the hosts on the indicated network for broadcasting
hierarchy of IP addreses
Site level
Host level
same netid
All the hosts in a network must have the ____ ___ which does not allow dividing a network into logical groups
subnetwork
Solution to allow for subdivision of networks into logical groups (internal split, but still act as a single network to the outside world)
Routing of a datagram now involves three steps: Delivery to the site, delivery to the ________, and delivery to the host
subnetid
With the existence of subnets, IP hostid is divided into _______ and hostid which can be changed later if required by ICANN
mask
32 bit number used for a router to find a network/subnet address
default mask
Used by routers outside of the organization
Gives the network address when AND’ed with an address in the block
The number of 1s is the same as the number of bits in the netID (8 for A, 16 for B, and 24 for C); the rest are all 0
subnet mask
Routers inside the organization use this type of mask
To make this type of mask, change some of the leftmost 0s in the default mask to 1s
2^n
The number of subnets is determined by the number of 1s
classless addressing
Announced in 1996
An idea of variable-length blocks that belong to no class was introduced to allocate remaining IP addresses
The number of addresses in a block must be a power of 2
The whole address space (2^32 addresses) is divided into blocks of different sizes
The beginning address must be evenly divisible by the number of addresses; if a site needs, say, 2000 addresses it is given a block of 2048 addresses on a 2048 address boundary
We can still use subnetting if there is a need
An organization is given the beginning address of the block and a mask (in slash notation)
classless interdomain routing
New method of forwarding packets for classless addresses
There is now a single routing table for all networks consisting of an array of (IP address, subnet mask, outgoing line) triples
When a packet comes in, its destination IP address is first extracted; the routing table is then scanned entry by entry, masking the destination address and comparing it to the table entry looking for a match
It is possible that multiple entries (with different subnet mask lengths) match, in which case the longest mask is used
IPv5
Was an experimental real-time stream protocol that was never widely used
Was designed to coexist with IPv4, not a replacement
major goals of IPv6
Larger address space
Inefficient address space
Better header format
Better security
Support for resource allocation
Allowance for extension
Coexistence
IPv6 header
8 fields (40 bytes)
Version (4 bits)
Traffic class (4 bits)
Flow label (24 bits)
Payload length (16 bits)
Next header (8 bits)
Hop limit (8 bits)
Source Address (16 bytes)
Destination Address (16 bytes)
IPv6 address notation
Hexadecimal colon notation (8 groups - 2 bytes each of four hexadecimal digits)
Many addresses will have many zeroe
IPv6 address notation abbreviation
Leading zeros in a group can be omitted
One or more groups of groups of 16 zero bits can be replaced by a pair of colons (allowed once per address)
IPv4 can be written as a pair of colons and an old dotted decimal number
categories of addresses in IPv6
Unicast
Multicast
Anycast
anycast category
Defines a group of computers with addresses that have the same prefix
Such a packet must be delivered to exactly one of the members of the group
The closest or the most easily accessible
transition from IPv4 to IPv6
Cannot happen suddenly, smooth transition is required
Three strategies designed
Dual stack
Tunneling
Header translation
mapping
Delivery of a packet of host or router requires two levels of addressing (IP and MAC)
Two types exist: static and dynamic
static mapping
Create a table that associates an IP address with a MAC address, stored in each machine on a network
Network performance is degraded to update the table periodically
A machine could change its network card
In some LANs such as LocalTalk of apple, the MAC address changes every time the computer is turned on
A mobile computer can move from one physical network to another
dynamic mapping
Each time a machine knows one of the two addresses, it can use a protocol to find the other one
Two protocols
ARP (maps an IP address to a MAC address)
RARP (maps a MAC address to an IP address; obsolete, replaced by DHCP- Dynamic Host Configuration Protocol)
address resolution protocol
A host or a router looking for a MAC address broadcasts an ARP query packet
Includes the MAC (physical) and IP addresses of the sender and the IP address of the receiver
Only the intended recipient sends back an ARP response packet (it contains the recipient’s IP and physical addresses)
Is unicast
dynamic host configuration protocol
A client-server program for assigning network addresses IP addresses, default routers)
Is an extension of BOOTP (that replaced RARP) that maps IP addresses to Ethernet addresses - it requires manual configuration of the table by an administrator when a new host is added - static
In contrast with BOOTP, it allows both manual and automatic IP address assignment
DHCP databases
One that statically binds physical addresses to IP addresses
The second holds a list of unassigned IP addresses that makes DHCP dynamic
How computers contact the DHCP server
The server checks its static database; if there is an entry that permanent address is returned
Otherwise it dynamically assigns an IP address for a fixed period of time
This allows sharing of address space - results in more efficient use of address space
DHCP relay agent
Needed on each LAN since the DHCP server may not be reachable by broadcasting
necessity of ICMP
IP has no error reporting and error correcting mechanisms; if something goes wrong
It lacks a mechanism for host and management queries (is a router or a host alive?
internet control message protocol
Is a companion to the IP designed to compensate for lack of error reporting and host/management query mechanisms
types of ICMP messages
Error-reporting
Query messages
error reporting messages
Always reports error messages to the original source (the only information included in the datagram is the source and destination addresses)
types of error reporting
Destination unreachable
Source quench
Time exceeded
Parameter problem
Redirection
destination unreachable
Type of error reporting message received when a router cannot locate the destination or when a packet with the DF bit cannot be delivered because a ‘‘small-packet’’ network stands in the way; the datagram is discarded
source quench
Type of error-reporting message
To slow down a source since IP is connectionless and lacks flow control and congestion control
Rarely used because when congestion occurs, these packets tend to aggravate it
Congestion control in the Internet is handled in the transport layer
time exceeded
Type of error-reporting message sent when a packet is dropped because its counter (Time to live) has reached zero (a symptom that packets are looping) or when all fragments that make up a message do not arrive at the destination host within a certain time limit
parameter problem
Type of error-reporting message that indicates that an illegal value has been detected in a header field
redirection
type of error-reporting message sent when a router notices that a packet seems to be routed wrong
routing protocol
A combination of rules and procedures that lets routers in the internet inform one another of changes (to share whatever they know about the internet or their neighborhood)
routing algorithm
The heart of a routing protocol
Determines the path for a packet
Constructs routing tables (mandatory for routing)