





















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An overview of IP addressing, homogeneous addressing, routing principles, and IP packet forwarding in the network layer of the TCP/IP architecture. It covers topics such as IP principles, network-layer connection-oriented and connectionless services, ICMP protocol, and ICMP redirect.
Typology: Slides
1 / 61
This page cannot be seen from the preview
Don't miss anything!
4: Network Layer 4-
Silvia Giordano ICA, EPFL
The transport layer relies on the services of the network layer, which provides a communication service between hosts. In particular, the network layer moves transport- layer segments from one host to another. At the sending host, the transport- layer segment is passed to the network layer. It is then the job of the network layer to get the segment to the destination host and pass the segment up the protocol stack to the transport layer.
4: Network Layer 4-
Chapter goals: r understand principles behind network layer services: m routing m how a router works m advanced topics: IPv6, multicast r instantiation and implementation in the Internet
Overview: r network layer services r routing principles r IP addresses r Internet routing protocols reliable transfer m intra-domain m inter-domain r ICMP r Routers, bridges and switches r IPv r multicast routing
4: Network Layer 4-
m network-layer connection-oriented service: virtual circuit m network-layer connectionless service : datagram
The network -service model defines the characteristics of end-to-end transport of data between one "edge" of the network and the other, that is, between sending and receiving end systems. The most important abstraction that the network layer provides to the transport layer is whether the network layer uses
With a virtual circuits layer a circuit management (setup, data-transfer, teardown) and signaling are needed.
With a datagram network layer, each time an end system wants to send a packet, it stamps the packet with the address of the destination end system, and then pops the packet into the network
4: Network Layer 4-
r call setup, teardown for each call before data can flow r each packet carries VC identifier (not destination host ID) r every router on source-dest path maintains “state” for each passing connection m transport-layer connection only involved two end systems r link, router resources (bandwidth, buffers) may be allocated to VC m to get circuit-like performance
“source-to-dest path behaves much like telephone circuit” m performance-wise m network actions along source-to-dest path
There are three identifiable phases in a virtual circuit:
4: Network Layer 4-
Datagram networks: the Internet model
r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection” r packets typically routed using destination host ID m packets between same source-dest pair may take different paths
application transport network data link physical
application transport network data link physical
Datagram routing is similar to routing ordinary postal mail: packet switches route a packet toward its destination by examining the packet's destination address, indexing a routing table with the destination address, and forwarding the packet in the direction of the destination. There is no “connection management ” as well as no tables or state are needed insiede the network. Different packets to the same destination can be routed via a different route. The current Internet architecture provides only one service model, the datagram service, which is also known as " best-effort service. " From the table, it might appear that best effort service is a euphemism for "no service at all." With best-effort service, timing between packets is not guaranteed to be preserved, packets are not guaranteed to be received in the order in which they were sent, nor is the eventual delivery of transmitted packets guaranteed. Given this definition, a network that delivered no packets to the destination would satisfy the definition of best-effort delivery service. However, there are sound reasons for such a minimalist network service model:
•it is easier to interconnect networks that used very different link- layer technologies
•it is easier to add a new service simply by attaching a host to the network and defining a new higher- layer protocol
The Internet's best-effort only service model is currently being extended to include so-called integrated services and differentiated service.
4: Network Layer 4-
The Internet Network layer
routing table
Host, router network layer functions:
Routing protocols •path selection •RIP, OSPF, BGP
IP protocol •addressing conventions •datagram format •packet handling conventions
ICMP protocol •error reporting •router “signaling”
Transport layer: TCP, UDP
Link layer physical layer
Network layer
The pieces of the network layer of the Internet are often collectively referred to as the IP layer (named after the Internet's IP protocol). We'll see, though, that the IP protocol itself is just one piece (albeit a very important piece) of the Internet's network layer. The Internet's network layer provides connectionless datagram service rather than virtual-circuit service. When the network layer at the sending host receives a segment from the transport layer, it encapsulates the segment within an IP datagram, writes the destination host address as well as other fields in the datagram, and sends the datagram to the first router on the path toward the destination host. The Internet’s network layer has three major components:
•The Internet Protocol, or more commonly, the IP Protocol , which defines network- layer addressing, the fields in the datagram (that is, the network- layer PDU), and the actions taken by routers and end systems on a datagram based on the values in these fields. There are two versions of the IP protocol in use today: IPv4 [RFC 791] and IPv6 [RFC 2373; RFC 2460], which has been proposed to replace IPv4 in upcoming years.
•The second major component of the network layer is the path determination component; it determines the route a datagram follows from source to destination. Examples of such components used in the Internet are RIP, OSPF, BGP.
•The Internet's network- layer error and information reporting protocol, ICMP , is a facility to report errors in datagrams and respond to requests for certain network- layer information..
4: Network Layer 4-
IP Addressing: introduction
r IP address: 32-bit identifier for host, router interface r interface: connection between host, router and physical link m router’s typically have multiple interfaces m host may have multiple interfaces m IP addresses associated with interface, not host, router
128.178.1.
128.178.1.
128.178.1.
128.178.1.4 (^) 128.178.2. 128.178.2.
128.178.2.
128.178.3.1 128.178.3.
128.178.3.
128.1.1.1 = 10000000 00000001 00000001 00000001
(^128 1 )
32 bits
interface1 interface
interface
An IP address is technically associated with an interface, rather than with the host or router containing that interface When IP in the host wants to send a datagram, it will do so over this link. The boundary between the host and the physical link is called an interface. A router's job is to receive a datagram on an "incoming" link and forward the datagram on some "outgoing" link, thus a router has multiple interfaces, one for each of its links.
Each IP address is 32 bits long (equivalently, four bytes), and there are thus a total of 2^32 possible IP addresses. 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. For example, consider the IP address 193.32.216.9. The 193 is the decimal equivalent of the first eight bits of the address; the 32 is the decimal equivalent of the second eight bits of the address, and so on. Thus, the address 193.32.216.9 in binary notation is:
11000001 00100000 11011000 00001001.
Each interface on every host and router in the global Internet must have an IP address that is globally unique.
4: Network Layer 4-
r IP address: m network (or prefix) part (high order bits) m host part (low order bits) r What’s a network? (from IP address perspective) m device interfaces with same network part of IP address m can physically reach each other without intervening router
128.178.1.
128.178.1.
128.178.1.
128.178.1.4128.178.2. 128.178.2.
128.178.2.
128.178.3.1 128.178.3.
128.178.3.
network consisting of 3 IP networks (for IP addresses starting with 128, first 24 bits are network address)
LAN 128.178.
Network 128.178.0.
IP addresses cannot be chosen in a willy- nilly manner, however. In primis, an interface's IP address will be determined by the "network" to which it is connected. The three hosts in the upper- left portion are on the same “IP network” identified by the initial part of their address 128.178.1, and the router interface to which they are connected all have an IP address of the form 128.178.1.xxx. That is, they share a common leftmost 24 bits of their IP address. The 24 address bits that they share in common constitute the network portion of their IP address; the remaining eight bits are the host portion of the IP address. The network itself also has an address: 128.178.1.0/24, where the "/24" notation, sometimes known as a network mask , indicates that the leftmost 24 bits of the 32-bit quantity define the network Sometimes, in the network mask the numbers are substituted with 255. Examples:
subnet mask at EPFL = 255.255.255.
What are the net:subnet and host parts of : lrcsuns .lrc.epfl.ch? The address is 128.178.156.
the prefix is 128.178.156.
At the origin, the prefix of an IP address was defined in a very rigid way. For class A addresses, the prefix was 8 bits. For class B, 16 bits. For class C, 24 bits. The interest of that scheme was that by simply analyzing the address you could find out what the prefix was.
The requirement that the network portion of an IP address be exactly one, two, or three bytes long turned out to be problematic for supporting the rapidly growing number of organizations with small and medium-sized networks. A class C (/24) network could only accommodate up to 28 - 2 = 254 hosts (two of the 2^8 = 256 addresses are reserved for special use)--too small for many organizations. However, a class B (/16) network, which supports up 65,634 hosts was too large. Under classful addressing, an organization with, say, 2,000 hosts was typically allocated a class B (/16) network address. This led to a rapid depletion of the class B address space and poor utilization of the assigned address space. It was soon recognized that this form was too rigid. Then subnets were added. It was no longer possible to recognize from the address alone where the subnet prefix ends and where the host identifier starts. For example, the host part at EPFL is 8 bits; it is 6 bits at ETHZ. Therefore, an additional information, that is the subnet mask, is necessary.
Class C addresses were meant to be allocated one per network. Today they are allocated in contiguous blocks.
4: Network Layer 4-
Examples: 128.178.x.x = EPFL host; 129.132.x.x = ETHZ host 9.x.x.x = IBM host 18.x.x.x = MIT host Class Range A B C D E
0.0.0.0 to 127.255.255. 128.0.0.0 to 191.255.255. 192.0.0.0 to 223.255.255. 224.0.0.0 to 239.255.255. 240.0.0.0 to 247.255.255. r Class B addresses are close to exhausted; new addresses are taken from class C, allocated as continuous blocks
0 Net Id
0 1 2 3… 8 16 24 31
10 Net Id 110 Net Id 1110 Multicast address 11110 Reserved
Subnet Id Host Id Host Id
class A class B class C class D class E
Host Id Subnet Id
With so-called CIDRized ( CIDR: Classless Interdomain Routing ) network addresses, the network part of an IP address can be any number of bits long, rather than being constrained to 8, 16, or 24 bits. A CIDRized network address has the dotted-decimal form a.b.c.d/x , where x indicates the number of leading bits in the 32-bit quantity that constitutes the network portion of the address. In our example above, the organization needing to support 2,000 hosts could be allocated a block of only 2,048 host addresses of the form a.b.c.d /21, allowing the approximately 63,000 addresses that would have been allocated and unused under classful addressing to be allocated to a different organization. In this case, the first 21 bits specify the organization's network address and are common in the IP addresses of all hosts in the organization. The remaining 11 bits then identify the specific hosts in the organization. In practice, the organization could further divide these 11 rightmost bits using a procedure known as subnetting to create its own internal networks within the a.b.c.d /21 network.
4: Network Layer 4-
r The prefix of an IP address is itself structured in order to support aggregation m For example: 128.178.x.y represents an EPFL host 128.178.156 / 24 represents the LRC subnet at EPFL 128.178 / 16 represents EPFL m Used between routers by routing algorithms m This way of doing is called classless and was first introduced in inter domain routing under the name of CIDR (classless interdomain routing) r Notation: 128.178.0.0/16 means : the prefix made of the 16 first bits of the string r It is equivalent to: 128.178.0.0 with netmask=255.255.0. r In the past, the class based addresses, with networks of class A, B or C was used; now only the distinction between class D and non-class D is relevant.
4: Network Layer 4-
r Sovkom has received IP addresses ___________ to ___________ r Java Business Solutions AG has received IP addresses ___________ to
r Tango SA has received IP addresses ___________ to
194.167.0.0/
Internet Service Provider SovKom
Java Business Solutions AG
Tango SA
194.167.41.0/
194.167.42.0/
194.167. 255.
194.167.0.
194.167.41.
194.167.41.
194.167.42. 194.167.43.
total: 2^16 addr., but .0 and .255 are not usable
total: 2^8 –2 addresses
total: 2*(2^8 –2) addresses
The following address blocks are reserved and cannot be used in the Internet. they are typically used in experimental or closed environments
10.0.0.0 - 10.255.255.255 (10/8)
172.16.0.0 - 172.31.255.255 (172.16/12)
192.168.0.0 - 192.168.255.255 (192.168/16)
4: Network Layer 4-
**1. 0.0.0.0 this host
r Example: 128.178.255.255:___________ 128.178.156.___: broadcast to all LRC net 128.178.156.0 : LRC net 129.132.119.64 : tik-sprach hostId = 0 designates the network
broadcast to EPFL 255
The IP packet forwarding algorithm is the core of the TCP/IP architecture. It defines what a system should do with a packet it has to send or to forward. The rule is simple:
It uses the IP routing table; the table can be checked with a command such as “netstat” with Unix or “Route” with Windows NT
4: Network Layer 4-
m if the destination IP address has the same prefix as one of self’s interfaces, send directly to that interface m otherwise send to a router as given by the IP routing table
destination@ subnetMask nextHop 128.178.156. DEFAULT
255.255.255. 128.178.156.
At lrcsuns: Next Hop Table IP subnetMask 128.178.156.24 255.255.255.
Physical Interface Tables
destination@ subnetMask nextHop 128.178.79. 128.178.156. DEFAULT
255.255.255. 255.255.255.0 128.178.182. 128.178.182.
At in-inj: Next Hop Table IP subnetMask
128.178.182. 128.178.79.
255.255.255. 255.255.255.
Physical Interface Tables
In reality there are exceptions to the rule. The complete algorithm is as above; the cases should be test in that order (it is a nested if then else statement).
Remember that the above is the packet forwarding algorithm. The tables are written by the control method (the routing algorithms).
4: Network Layer 4-
IP Unicast Packet Forwarding Algorithm
Read destAddr= destination IP address /* assume it is unicast */ Case 1: a host route exists for destAddr for every entry in routing table if (destinationaddr= destAddr) then send to nextHop IPaddr; leave Case 2: destAddr is on a directly connected network (=on-link): for every physical interface IP address A and subnet mask sm if( A & sm = destAddr & sm) then send directly to destAddr; leave Case 3: a network route exists for destAddr for every entry in routing table if (destinationaddr & subnetMask = destAddr & subnetMask) then send to nextHop IP addr; leave Case 4: use default route for every entry in routing table if (destinationaddr=DEFAULT) then send to nextHop IPaddr; leave