Chapter III
Chapter III
Chapter III
Network Layer
2 Contents
Introduction
Internet protocol and IP addressing
Address mapping, error reporting and Group Management Protocols
Routing algorithms
Asynchronous Transfer Mode (ATM) (Example for WAN Protocol)
3
4
Introduction
5
It is the lowest layer that deals with end-to-end packet (i.e. Network layer data unit)
transmission.
The first duty of the network layer is packetizing: encapsulating the payload in a network-layer
packet at the source and decapsulating the payload from the network-layer packet at the
destination.
Forwarding:- involves the transfer of a packet from an incoming link to an outgoing link within
a single router.
Routing:- involves all of a network’s routers, whose collective interactions via routing protocols
(algorithms) determine the paths that packets take on their trips from source to destination
node.
6 Introduction cont….
Connection setup:
Connection-oriented communication (virtual circuit network) and
Connectionless communication (datagram network)
Store-and-Forward Packet Switching: A host with a packet to send transmits it to the nearest
router. The packet is stored there until it has fully arrived and the link has finished its
processing by verifying the checksum.
Then forwarded to the next router along the path until it reaches the destination host, where it
is delivered. This mechanism is store-and-forward packet switching.
Security: network layer provide a security for a connectionless service, for this purpose we
need to have another virtual level (IPsec) that changes the connectionless service to a
connection-oriented service.
7 Introduction cont….
Services Provided to the Transport Layer:
The services provided to the transport layer by the network layer can be carefully designed by
considering the following transport layer requirements in mind:
1.The services should be independent of the router technology.
2. The transport layer should be shielded from the number, type, and topology of the routers
present.
3. The network addresses made available to the transport layer should use a uniform numbering
plan, even across LANs and WANs.
The network layer should provide connection oriented or connectionless service to transport layer.
Connectionless and Connection-oriented
8
Communication
10 Network-Layer Performance Measures
The performance of a network can be measured in terms of delay, throughput, and packet loss
(sometimes congestion control can also be consider to improve the performance).
The delays in a network can be divided into four types: transmission delay, propagation delay,
processing delay, and queuing delay.
Throughput is the number of bits passing through the point in a second, which is actually the
transmission rate of data at that point.
Another issue that severely affects the performance of communication is the number of packets
lost during transmission.
Introduction cont….
11
Router
Router cont….
12
Two main functions:
Run routing algorithms/protocols (e.g., RIP, OSPF, IGRP and others).
Forwarding datagrams from incoming to outgoing links
17 Internet protocol and IP addressing
IP is part of the TCP/IP suite and is the most widely used internetworking protocol.
As with any protocol standard, IP is specified in two parts:
The interface with a higher layer (TCP/UDP), specifying the services that IP provides
The actual protocol format and mechanisms
IP basic characteristics:
Connectionless - No connection is established before sending data packets.
Best Effort (unreliable) - No overhead is used to guarantee packet delivery.
Media Independent - Operates independently of the medium carrying the data.
IP Header
18
IPv4 Addressing
21
IP address: it is a 32-bit identifier for host and router interfaces (both physical and logical
interfaces have an ip address).
Interface is a boundary between the host and the physical link in computer networking.
An IP address is technically associated with an interface, rather than with the host or router
containing that interface.
These addresses are typically written in so-called dotted-decimal notation, in which each byte of
the address is written in its decimal form and is separated by a period (dot) from other bytes in
the address.
Example:
These addresses cannot be chosen in a willy-nilly manner, however. A portion of an interface’s
IP address will be determined by the subnet to which it is connected.
22 IPv4 Addressing cont…
IPv4 Addressing cont….
23
Network Classes: the address is coded to allow a variable allocation of bits to specify network and host. This
encoding provides flexibility in assigning addresses to hosts and allows a mix of network sizes on an internet.
The three principal network classes are best suited to the following conditions:
Class A: Few networks, each with many hosts
Class B: Medium number of networks, each with a medium number of hosts
Class C: Many networks, each with a few hosts
IPv4 Addressing cont…..
24
The Internet’s address assignment strategy is known as Classless Interdomain Routing (CIDR).
CIDR generalizes the notion of subnet addressing. As with subnet addressing, the 32-bit IP address is divided
into two parts and again has the dotted-decimal form a.b.c.d/x (x is a network prefix).
The x most significant bits of an address of the form a.b.c.d/x constitute the network portion of the IP address.
The number of bits used in host portion determines the number of hosts that we can have within the network.
Types of Addresses in IPv4 Network
Network address ‐ The address by which we refer to the network
Broadcast address ‐ A special address used to send data to all hosts in the network
Host addresses ‐ The addresses assigned to the end devices (including router interfaces) in the network
Subnet and Network Prefixes (Subnet
25 Masking)
Subnetting is the process of splitting the larger network into a number of smaller networks.
Within the subnetted network, the local routers must route on the basis of an extended network
number consisting of the network portion of the IP address and the subnet number.
Because of Subnetting we get the following advantages:
Network traffic was reduced
Network performance become optimized
Network management become simple
Network supports large geographic area
The prefix length (x in the previous slide) is the number of bits in the address that gives us the
network portion.
27 Subnet cont…
How to Create Subnets
To create a subnet answer the following questions:
How many subnets does the chosen subnet mask produced? It can be calculated using 2 n-dp,
where n is the given network prefix and dp is the default prefix for the given class (i.e. class A, B
or C) when IP address is a Classful IP or dp is the network prefix given from ISP.
How many valid hosts per subnet are available? It can be calculated using 2 32-n-2.
What are the valid subnets addresses?
What’s the broadcast address of each subnets?
What are the valid hosts in each subnet?
Subnet cont…..
31
Variable Length Subnet Masks (VLSM)
IPv6: Structure and Address Space
35
The IP (IPv4) has been the foundation of the Internet and virtually all multivendor private
internetworks.
This protocol is reaching the end of its useful life and a new protocol, known as IPv6 (IP version
6), has been defined to ultimately replace IP.
The driving motivation for the adoption of a new version of IP was the limitation imposed by
the 32-bit address field in IPv4.
With a 32-bit address field, it is possible in principle to assign 232different addresses, which is
over 4 billion possible addresses.
36 IPv6 cont……
Reasons for the inadequacy of 32-bit addresses include the following:
The two-level structure of the IP address is convenient but wasteful of the address space.
Networks are multiplying rapidly.
Growth of TCP/IP usage into new areas will result in a rapid growth in the demand for
unique IP addresses.
Multiple IP addresses are required for a single host.
IPv6 cont……
37
IPv6 includes the following enhancements over IPv4:
Expanded address space: IPv6 uses 128-bit addresses.
Improved option mechanism: IPv6 options are placed in separate optional headers that are
located between the IPv6 header and the transport-layer header. It also makes it easier to add
additional options.
Increased addressing flexibility: IPv6 includes the concept of an anycast address in addition to
the existing casting mechanisms in IPv4 (i.e. Unicast, Multicast and Broadcast).
Support for resource allocation: IPv6 enables the labeling of packets belonging to a particular
traffic flow for which the sender requests special handling. This aids in the support of
specialized traffic such as real-time video.
IPv6 Header
38
IPv6 addresses are represented by treating the 128-bit address as a sequence of 8 16-bit numbers, and representing
this in the form of eight hexadecimal numbers divided by colons, for example:
2001:0DB8:0055:0000:CD23:0000:0000:0205
One to three zeroes that appear as the leading digits in any colon-delimited hexadecimal grouping may be dropped
(2001:0DB8:55:0:CD23:0:0:0205)
A group of all zeroes, or consecutive groups of all zeroes, can be substituted by a double colon, but this may only
be done once in an address. Example: 2001:0DB8:55::CD23:0:0:0205 or 2001:0DB8:55:0:CD23::0205
Structure of IPv6
ipv6-address/prefix-length
prefix-length is a decimal value specifying how many of the leftmost contiguous bits of the address comprise the
prefix. Example: 2001:0DB8:55:0:CD23::0205/48 or ::/64 or ABC::B:0:1234/80
Internet Control Message Protocol (ICMP)
42
ICMP provides a means for transferring messages from routers and hosts each other. In
essence, ICMP provides feedback about problems in the communication environment.
Examples: when a datagram cannot reach its destination, or when the router does not have the
buffering capacity to forward a datagram.
An ICMP message is sent in response to a datagram, either by a router along the datagram’s
path or by the intended destination host.
Although ICMP is, in effect, at the same level as IP in the TCP/IP architecture, it is a user of
IP.
An ICMP message is constructed and then passed down to IP, which encapsulates the message
with an IP header and then transmits the resulting datagram in the usual fashion.
ICMP cont….
43
Logical address (IP address): it is a network address uniquely identify networks in the wide area
network.
Physical address: it is a MAC (Medium Access Control) address, which provides a physical address
for a host port attached to the LAN.
To deliver an IP datagram to a destination host, a mapping must be made from the IP address to the
subnetwork (MAC) address for that last hop.
If a datagram traverses one or more routers between source and destination hosts, then the mapping
must be done in the final router, which is attached to the same subnetwork as the destination host.
If a datagram is sent from one host to another on the same subnetwork, then the source host must do
the mapping.
Address Mapping cont….
49
For this purpose, a number of approaches are possible, it include:
Each system can maintain a local table of IP addresses and matching subnetwork addresses for possible
correspondents.
A centralized directory can be maintained on each subnetwork that contains the IP-subnet address
mappings.
An address resolution protocol can be used.
52
Network Address Translation (NAT)
NAT cont….
53
The basic idea behind NAT is for the ISP to assign each home or business a single (few) public IP
address(es) for Internet traffic.
Within the customer network, every computer gets a unique IP address, which is used for routing in
the intranet traffic. However, just before a packet exits the customer network and goes to the ISP, an
address translation from the unique internal IP address to the shared public IP address takes place.
This translation makes use of three ranges of IP addresses that have been declared as private. The
only rule is that no packets containing these addresses may appear on the Internet itself.
If all datagrams arriving at the NAT router from the WAN have the same destination IP address,
then how does the router know the internal host to which it should forward a given datagram?
The router uses a NAT translation table, and to include port numbers as well as IP addresses in the
table entries.
54 NAT cont….
NAT has enjoyed widespread deployment in recent years. But it has some limitations:
First port numbers are meant to be used for addressing processes, not for addressing hosts.
Second routers are supposed to process packets only up to layer 3.
Third the NAT protocol violates the so-called end-to-end argument; that is, hosts should be
talking directly with each other, without interfering nodes modifying IP addresses and port
numbers.
Fourth it interferes with P2P applications, including P2P file-sharing applications and P2P
Voice-over-IP applications.
Example
55