1/113
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.
Responsible for routing the packets through the routers or switches.
Internetworking
Refers to the logical gluing of heterogeneous physical networks together to look like a single network to the upper transport and application layers.
Hosts
The sources and destinations in internetworking are usually referred to as _______.
Hop
A host or router in internetworking is referred to as a _______.
Network layer at source
Receives data from the transport layer
Adds the universal addresses of A and D
Makes sure the packet is correct size for passage through the next link, fragment it 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 the fragments
Delivering to the transport layer
Addressing
Used to uniquely and universally identify each device on the internet to allow global communication between all devices.
Each address belongs to a single host, but a single host can have multiple addresses if it has multiple connections to the internet.
Internet address
The identifier used in the network layer of the internet model.
IP address
32-bit binary address
Common address notations
Binary notation
Dotted-decimal notation
Binary notation
One or more spaces inserted between each octet(8 bits)
Dotted-decimal notation
Used to make it more compact and easier to read ( for humans)
Packetizing
Encapsulates 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 in another frame.
Received frame
Format and size depends on the protocol used by the physical network from which the frame has just received
Departing frame
Format and size depend on the protocol used by the physical network to which the frame is going.
Other issues of the internet not directly related to the network layer
Address resolution
Multicasting
Routing Protocols
Network layer protocols in TCP/IP
IP
ARP
RARP(DHCP)
ICMP
IGMP
IP
The main protocol
The glue that holds the whole internet together
Responsible for host-to-host delivery
Also needs the services of the other protocols
ARP
Address Resolution Protocol
Maps an IP address to a MAC address (of the next hop)
RARP
Reverse ARP
Maps a MAC address to an IP address
Usually used in some situations such as when a diskless host is booted
It gets binary image of its operating system from a remote file server but does not know its IP address
Obsolete, replaced by DHCP - Dynamic Host Configuration Protocol
ICMP
Internet Control Message Protocol
Used to handle unusual situations such as the occurrence of an error
IGMP
Internet Group Management Protocol
Used for multicasting since IP is designed for unicast delivery
IP v4
Connectionless
Unreliable
Best effort delivery
Only detects errors and discards if it is corrupted.
Transmitted in big endian order
IP datagram
header + text
Options
To allow subsequent versions of the protocol to include information not present int the original design.
To permit experimenters to try new ideas
To avoid allocating header bits to rarely needed information
Types of options
Security
Strict source routing
Loose source routing
Record route
Timestamp
Security option
For a router to specify not to route through certain countries.
Ignored by all routers in practice.
Strict source routing option
Gives the complete path from source to destination as a sequence of IP addresses
For system managers to send emergency packets when routing tables are corrupted
for making timing measurements
Loose source routing option
Requires the packet to traverse List of routers specified in the order specified but also may also pass through other routers on the way.
Record route option
Tells routers along the path to append their IP address to the option field.
For system managers to track down bugs in routing algorithms
Timestamp option
Each router records a 32-bit timestamp
Mostly for debugging routing algorithms
Classful addressing
Address space is divided into 5 classes ( A - E )
The first few bits indicate the class of an address
Classes for unicast communication
Addresses in classes A, B, and C
A host needs to have at least one unicast address to be able to send and receive.
Classes for multicast communication
Addresses in class D
If a host belongs to a group or groups, it can have one or more multicast addresses.
Reserved classes
Addresses in class E
Used for special purposes
netid, hostid
Addresses in classes A, B, and C are divided into ________ and _________ of varying length from class to class.
Problem with classful addressing
Each class is divided into fixed number of blocks with each block having fixed size.
Class A
Divided into 128 blocks with each block having a different netid.
0 - 127
First bit of byte 1 is always 0
For large organizations
Up to 16 million hosts 224
Class B
Divided into 16,384 = 214 blocks, each block having a different netid.
128 - 191
First two bits of byte 1 are always 10
16 blocks are reserved for private addresses
Class C
Divided into 2,097,152 = 221 blocks, each block having a different netid.
192 - 223
The fist 3 bits of 1 byte are always 10.
256 blocks are used for private addresses
Class D
One block of this address designed for multicasting
224 - 239
Class E
One block of this address designed for use as reserved addresses.
240 - 255
Network address
An address that defines the network itself.
It cannot be assigned to a host.
Network address properties
All hostid bytes are 0
Defines the network to the rest of the internet. Routing is based on this.
In classful addressing, this is the one assigned to the organization.
ICANN
Internet Corporation for Assigned Names and Numbers
A nonprofit that manages network addresses.
IP address with all 0s
It means this network or this host
IP address with all 1s
It means all the hosts on the indicated network for broadcasting.
IP address levels of heirarchy
Site
Subnet
Host
Subnet
A logical sub-division of an IP network.
Subnetting
The practice of dividing a network into two or more networks.
Computers that belong to a subnet are addressed with an identical most significant bit-group in their IP addresses.
Steps of routing of a datagram
Delivery to the site
Delivery to the subnetwork
Delivery to the host
subnetid, hostid
The IP hostid is divided into _________ and _________.
First host number
Reserved to identify the subnet itself.
Last host number
Reserved to broadcast within the subnet
The mask
32-bit number used to find the network address or subnet address.
Default mask
32-bit binary number that gives the network address when ANDed with an address in the block.
The number of 1s is the same as the number of bits in the netid.
Slash notation
An alternative mask notation
A slash followed by the number oof 1s
Subnet mask
Who are your neighbors in the network
Change some of the leftmost 0s in the default mask to 1s.
The number of subnets is determined by the number of 1s( 2n )
Classless addressing
Variable-length blocks that belong to no class
The number of addresses in a block must be a power of 2
The beginning addresses must be evenly divisible by the number of addresses
We can still use subnetting if needed
An organization is given the beginning address of the block and a mask in slash notation
CIDR
Classless Inter Domain Routing
Means for forwarding packets in classless addressing.
Uses a single routing table for all networks consisting of an array of IP address, subnet mask, outgoing line triples.
Steps of CIDR
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
If there were multiple entries with different subnet mask lengths matching, we use the longest mask.
IPv5
It was an experimental real-time stream protocol that was never widely used.
Was designed to coexist with IP v4, not a replacement.
IPv6
Header has 8 fields ( 40 bytes )
Version (4 bits) - 6
Traffic class (4 bits)
Flow label ( 24 bits)
Payload length ( 16 bits )
Next header ( 8 bits )
Hop limit ( 8 bits )
Source address ( 16 byte )
Destination address (16 bytes)
Traffic class
Used to distinguish between packets with different real-time delivery requirements.
Flow label
Used to provide special handling for a particular flow of data.
Major goals of IPv6
Larger address space
Better header format
Better security
Support for resource allocation
Allowance for extension
Coexistence
IPv6 addresses notation
Hexadecimal colon notation
Eight groups ( each with 2 bytes) of four hexadecimal digits with colons between the groups
IPv6 abbreviation methods
Leading zeros (not the trailing ones) within a group can be omitted
One
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.
Dynamic mapping
Each time a machine knows one of the two addresses, it can use a protocol to find the other one.
ARP ( IP → MAC)
RARP ( MAC → IP)
ARP
Broadcasted by a host or a router looking for a MAC address.
Includes MAC and IP addresses of the sender and IP address of the receiver.
Unicast
Each computer connected to the internet must have
Its IP address
Subnet mask
IP address of the router
IP address of a name server
DHCP
A client server program for assigning network addresses.
Allows both manual and automatic IP address assignment.
DHCP server databases
One statistically binds physical addresses to IP addresses
Second one holds a list of unassigned IP addresses that makes the DHCP dynamic
leased
Addresses are __________ for some time; when the time expires the client must request renewal allowing the sharing of address space.
DHCP relay agent
Needed on each LAN incase DHCP server not reachable by broadcasting.
ICMP
Internet Control Message Protocol
A companion to the IP designed to compensate the error reporting and host and management query mechanisms the IP lacks
ICMP messages
Error reporting
Query messages
ICMP Error reporting
Destination unreachable - discards datagram
Source quench - slowing down a source
Time exceeded
Parameter problem - detecting an illegal value in header
Redirection
Routing
Making a decision and choosing one route whenever there are multiple routes.
Requires a router to have a routing table.
Routing protocol
A combination of rules and procedures that let routers inform one another of changes.
Routing algorithm
Main part of routing protocol and determines the path for a packet.
Methods of reducing routing table size
Next hop routing
Network specific routing
Next hop routing
The routing table holds only the information that leads to the next hop
Network specific routing
There is only an entry for the address of the network itself instead of an entry for every host connected to it.
Types of routing algorithms
Nonadaptive ( static )
Adaptive ( dynamic )
Nonadaptive routing algorithm
The administrator enters the route for each destination into the table
Adaptive
Routing decisions are made periodically
Types of routing protocols
Interior routing
Exterior routing
Autonomous system
A group of networks and routers under the authority of a single administration.
Interior routing
Routing inside an autonomous system.
Each AS can choose its own
Exterior routing
Routing between AS
One protocol is chosen to handle routing between AS
Optimality principle
Chose an optimal route from source to destination
Sink tree
The set of the optimal routes from all sources to a given destination form a tree rooted at the destination.
Shortest path routing
For unicast routing
To select a route between two routers, the algorithm finds the shortest path between them on the graph.
Each node labeled with its distance from the source may be tentatively or permanently.
Flooding
For multicast and broadcast routing.
Every incoming packet is sent out on every outgoing line except the one it arrived on.
Not mostly practical