Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
33 views

Data Communications: Network Layer

Network layer duties include internetworking, addressing, routing, packetizing, and fragmenting. The network layer determines the best route through the network to the final destination based on network layer addresses, which include both a network and host identifier to uniquely and universally locate devices. IP addresses can be static, assigned manually, or dynamic, assigned automatically by a server when the device connects to the network.

Uploaded by

Liston Kiwoli
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Data Communications: Network Layer

Network layer duties include internetworking, addressing, routing, packetizing, and fragmenting. The network layer determines the best route through the network to the final destination based on network layer addresses, which include both a network and host identifier to uniquely and universally locate devices. IP addresses can be static, assigned manually, or dynamic, assigned automatically by a server when the device connects to the network.

Uploaded by

Liston Kiwoli
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 90

Data communications

Network layer
Reference Books
• Data and Computer Communications by William
Stallings , Sixth Edition , Publisher Prentice Hall
• Data Communications and Networking by
Behrouz A Forouzan, Behrouz Forouzan, 4th
Edition
• Andrew S. Tanebaum, Computer networks 5th
Ed(2011), Prentice Hall
Topics

• What is an IP address ?
• Types of IP addressing
• Classes of IP address
• Networks & subnetworks
• IP addresses and routing
Network layer duties
• Internetworking
• Addressing
• Routing
• Packetizing
• Fragmenting
Figure 2.18 Relationship of layers and addresses in TCP/IP

2.5
Internet Addressing
• IPv4: is a 32-bit global internet address
• IPv6: is a 128-bit internet address, however it is not widely
implemented yet as IPv4.  An IPv6 address consists of 128 bits
written in a hexadecimal notation and grouping 16 bits separated
by colons. 2001:db8::/32
• Includes network and host identifiers (unique &
universal)
• Dotted decimal notation
— 11000000 11100100 00010001 00111001 (binary)
— 192.228.17.57 (decimal)

6
Internet Addresses
• The Internet is quickly running out of addresses.
Although there are more than 4 billion possible
addresses, the fact that they are assigned in
sets (or groups) significantly restricts the
number of usable addresses.
• The IP address shortage was one of the reasons
behind the IPv6, providing in theory, 3.2 x 1038
possible addresses.
How to apply for IP address?

7
Addressing
• The network layer determines the best route through the network to
the final destination.
• Based on this routing, the network layer identifies the data link layer
address of the next computer to which the message should be sent.
• In general, the data link layer address is permanently encoded in
each network card, and as part of the hardware that cannot be
changed.
• Network layer addresses are generally assigned by software. Every
network layer software package usually has a configuration file that
specifies the network layer address for that computer.
• An address fulfills the functions of identifying the host and locating it
on the network.
Assigning Addresses
• Application layer addresses (or server
addresses) are also assigned by a software
configuration file. Virtually all servers have an
application layer address, but most client
computers do not.
• Network layer addresses and application layer
addresses go hand in hand.
(ruby.bus.utexas.edu - means 146.6.44.95 at
the network layer.)
Types of addresses

Address Example Software Example Address

Application Layer Web browser ike.ba.ttu.edu


Network Layer TCP/IP 129.118.49.189
Data Link Layer Ethernet 00-A0-C9-96-1D-90

10
*How IP Addresses Distributed

• Internet Corporation for Assigned Names and


Numbers (ICANN) oversees the Internet Assigned
Numbers Authority (IANA) and controls how the Net's
4.29 billion IP addresses are used.
• IANA distributes address space to three geographically
diverse Regional Internet Registries (RIRs) and
encourage three RIRs to operate so that addresses
remain unique, are mapped efficiently, and are treated
as a precious resource.
• Three RIRs role out available pools of IP based on a
shared criteria. All deploy numerical address space to
ISPs, local registries, and in some cases small users.

11
IP Address Allocation
IANA

InterNIC RIPE APNIC


America Europe Asia

National

Regional

Consumer
12
Three RIRs
• American Registry for Internet Numbers (ARIN)
• Reseaux IP Europeen (RIPE)
• Asia Pacific Network Information Centre (APNIC)

13
Network Layer
• Concerned with getting packets from source to
destination.
• The network layer must know the topology of the
subnet and choose appropriate paths through it.
• When source and destination are in different
networks, the network layer (IP) must deal with
these differences.
* Key issue: what service does the network layer
provide to the transport layer (connection-
oriented or connectionless).

14
What is an IP address?

• IP (Internet Protocol) address


—device used by routers, to select best path from source
to destination, across networks and internetworks
—network layer address, consisting of NETWORK
portion, and HOST portion
—logical address,assigned in software by network
administrator
—part of a hierarchical ‘numbering scheme’ - unique, for
reliable routing
—may be assigned to a host pc, or router port
Figure : Network layer at the source, router, and destination
IP Fragmentation

• What if the size of an IP datagram exceeds the MTU (maximum transmission unit)?
IP datagram is fragmented into smaller units.

• What if the route contains networks with different MTUs?

Ethernet
FDDI
Ring
Host A Router Host B
MTUs: FDDI: 4352 Ethernet: 1500

• Fragmentation:
• IP router splits the datagram into several datagram
• Fragments are reassembled at receiver

17
Where is Fragmentation done?

—Fragmentation can be done at the sender or at


intermediate routers
—The same datagram can be fragmented several
times.
—Reassembly of original datagram is only done at
destination hosts !!

IP datagram H Fragment 2 H2 Fragment 1 H1

Router

18
IP Service

• Delivery service of IP is minimal

• IP provides an unreliable connectionless best effort service (also called:


“datagram service”).
— Unreliable: IP does not make an attempt to recover lost packets
— Connectionless: Each packet (“datagram”) is handled independently.
IP is not aware that packets between hosts may be sent in a logical
sequence
— Best effort: IP does not make guarantees on the service (no
throughput guarantee, no delay guarantee,…)

• Consequences:
• Higher layer protocols have to deal with losses or with duplicate
packets

• Packets may be delivered out-of-sequence


19
Types of IP address
1. Static address
2. Dynamic address
• Dynamic IP address
—examples - BOOTP, DHCP
— assigned by server when host boots
—derived automatically from a range of addresses
—duration of ‘lease’ negotiated, then address released back to server
• Static IP address
—manually input by network administrator
—manageable for small networks
—requires careful checks to avoid duplication
The need for dynamic addressing
• An address assignment problem: each time
the computer is moved, or it’s assigned a new
address, the software on each individual
computer must be updated
• Solution: dynamic addressing; With this
approach, a server is designated to supply a
network layer address to a computer each time
the computer connects to the network.
Address Resolution
• Address resolution: The sender translates the
application layer address (or server name) of the
destination into a network layer address; and in turn
translates that into a data link layer address.
• Domain Name System: Used for translating
application layer addresses into network layer
addresses.
• Two approaches used in TCP/IP
—Server address resolution
—Data link layer address resolution.
Classful vs classless addressing
• A prefix can be fixed length or variable length. The network identifier
in the IPv4 was first designed as a fixed-length prefix. This scheme,
which is now obsolete, is referred to as classful addressing.
– The reason that classful addressing has become obsolete is address depletion. Since
the addresses were not distributed properly, the Internet was faced with the problem of
the
addresses being rapidly used up, resulting in no more addresses available for
organizations and individuals that needed to be connected to the Internet.
– To alleviate address depletion, two strategies were proposed and, to some extent,
implemented: subnetting and supernetting.
• The new scheme, which is referred to as classless addressing,
uses a variable-length network prefix.
Classful Addressing: Classes of IP address

• Class A - large organizations , governments


• Class B - medium sized organizations
• Class C - small organizations
Classful Addresing :Internet Classes

IP Addresses in Decimal Notation


Figure 24-7
Class Ranges of Internet Addresses
Address space in classful addressing
Figure 24-8
Network and Host Addresses
Subnets

• A subnetwork or subnet is a logical subdivision of an 


IP network. The practice of dividing a network into two or
more networks is called subnetting.
• Assign IP addresses to specific computers so that all
computers on the same local area network have a similar
address.
• Each LAN that is logically grouped together by IP number is
called a TCP/IP subnet.
• Benefit:
—allows it to be connected to the Internet with a single
shared network address
—a necessary use of the limited number of network numbers

29
Classless addressing
• Although the long-range solution has already been
devised and is called IPv6 (discussed later), a short-term
solution was also devised to use the same address space
but to change the distribution of addresses to provide a
fair share to each organization.
• The short-term solution still uses IPv4 addresses, but it is
called classless addressing.
• In other words, the class privilege was removed from the
distribution to compensate for the address depletion.
Internet Service Provider
• An ISP is an organization that provides Internet access for
individuals, small businesses, and midsize organizations that do not
want to create an Internet site and become involved in providing
Internet services (such as electronic mail) for their employees.
• An ISP can provide these services.
• An ISP is granted a large range of addresses and then subdivides
the addresses (in groups of 1, 2, 4, 8, 16, and so on), giving a
range of addresses to a household or a small business.
• The customers are connected via a dial-up modem, DSL, or cable
modem to the ISP. However, each customer needs some IPv4
addresses.
Classless addressing
• Unlike classful addressing, the prefix length in classless addressing is
variable.
• We can have a prefix length that ranges from 0 to 32.
• The size of the network is inversely proportional to the length of the
prefix. A small prefix means a larger network; a large prefix means a
smaller network.
• We need to emphasize that the idea of classless addressing can be easily applied to
classful addressing. An address in class A can be thought of as a classless address in
which the prefix length is 8. An address in class B can be thought of as a classless
address in which the prefix is 16, and so on. In other words, classful addressing is a
special case of classless addressing.
Subnetting benefits
• The benefits of subnetting an existing network vary with each
deployment scenario.
• In the address allocation architecture of the Internet using 
Classless Inter-Domain Routing (CIDR, pronounced
cider) and in large organizations, it is necessary to allocate address
space efficiently.
• It may also enhance routing efficiency, or have advantages in
network management when subnetworks are administratively
controlled by different entities in a larger organization.
• Subnets may be arranged logically in a hierarchical architecture,
partitioning an organization's network address space into a tree-
like routing structure.
CIDR notation
• CIDR (Classless Inter-Domain Routing)
• The net id may be expressed in CIDR notation
written as the first address of a network, followed
by a slash character (/), and ending with the bit-
length of the netid.
• Example, 192.168.1.0/24 is the net id of the IPv4
network starting at the given address, having 24
bits allocated for the network id, and the
remaining 8 bits reserved for host addressing.
Exctracting information from an address
Example
Address mask
Example 2

• We repeat Example 1 using the mask. The mask in dotted-decimal notation is


255.255.255.224. The AND, OR, and NOT operations can be applied to individual bytes
using calculators
• Solution

• The first address, the network address, is particularly important because it is used in
routing a packet to its destination network.
• The network address is actually the identifier of the network; each network is identified
by its network address.
Designing subnets
Example 3
Example 3 solution
IP addresses and routing

• routing tables
• Identifying source and destination
• IP packet routing

• Routing tables
—created by router, held in memory, constantly updated
• based on cross-referencing
—IP packet source address, and port on which received
Identifying source and destination
—as part of a layer 3 packet, IP header contains
source and destination address
—each address is 32 bits long, and unique to device or
port
—router reads destination IP address, checks against
routing tables
Default mask

• The mask can help us to find the netid and the


hostid. For example, the mask for a class A
address has eight 1s, which means the first 8
bits of any address in class A define the netid;
the next 24 bits define the hostid.
subnetting
Default mask
Subnet mask
IP addresses and routing - IP packet routing
—if destination address not on the same segment as
receive port, router sends packet to correct port for
routing to destination
—if destination on same segment as receive port,
packet not forwarded
Subnet Mask

Subnet mask enables a computer to determine


which computers are on the same subnet. This
is very important for message routing.
E.g.
IP address: 129.118.49.189
Subnet mask: 255.255.255.0
IP address: 129.118.49.x is for the
computers in the same subnet

49
why subnet
—reduce broadcast domain, improve network efficiency
—Subnet masks
– extend NETWORK portion, borrow from HOST portion
– allow external networks to route packets direct to subnet
Addresses with and without Subnetting
Figure 24-12
Masking
examples
Network Address Translation (NAT)

• a translation table has only two columns: the private address and
the external address (destination address of the packet).
• When the router translates the source address of the outgoing packet, it
also makes note of the destination address where the packet is going.
• When the response comes back from the destination, the router uses the
source address of the packet (as the external address) to find the private
address of the packet.
NAT
Routing
• there are several routes that a packet can travel from the source to the
destination; what must be determined is which route the packet should take.
• To find the best route, an internet can be modeled as a graph
• A graph in computer science is a set of nodes and edges (lines) that connect
the nodes.
• To model an internet as graph, we can think of each router as a node and
each network between a pair of routers as an edge. An internet is, in fact,
modeled as a weighted graph, in which each edge is associated with a cost.
• we assume that there is a cost associated with each edge.
Least cost routing
• In Least cost routing: the source router chooses a route
to the destination router in such a way that the total
cost for the route is the least cost among all possible
routes
Distance vector routing
Figure 21-14

Single-Protocol versus Multiprotocol Router


Figure 21-15
Brouter
Figure 21-16
Switch
Figure 21-18
The Concept of Distance
Vector Routing
Figure 21-19

Distance Vector Routing Table


Figure 21-20

Routing Table Distribution


Figure 21-21

Updating Routing Table for Router A


Figure 21-22
Final Routing Tables
Figure 21-23
Example 21.1
Figure 21-24
Concept of Link State Routing
Figure 21-25
Cost in Link State Routing
Figure 21-26

Link State Packet


Figure 21-27
Flooding of A’s LSP
Figure 21-28
Link State Database
Figure 21-29

Costs in the Dijkstra Algorithm


Figure 21-30, Part I

Shortest Path Calculation, Part I


Figure 21-30, Part II

Shortest Path Calculation, Part II


Figure 21-30, Part III

Shortest Path Calculation, Part III


Figure 21-30, Part IV

Shortest Path Calculation, Part IV


Figure 21-30, Part V

Shortest Path Calculation, Part V


Figure 21-30, Part VI
Shortest Path Calculation, Part VI
Figure 21-31, Part VII

Shortest Path Calculation, Part VII


Figure 21-31, Part I

Shortest Path Calculation, Part VIII


Figure 21-31, Part II

Shortest Path Calculation, Part IX


Figure 21-31, Part III

Shortest Path Calculation, Part X


Figure 21-31, Part IV
Shortest Path Calculation, Part XI
Figure 21-31, Part V

Shortest Path Calculation, Part XII


Figure 21-31, Part VI

Shortest Path Calculation, Part XIII


Figure 21-32
Routing Table for Router A
Figure 24-9

A Network with Two Levels of Hierarchy


Figure 24-10

A Network with Three Levels of Hierarchy

You might also like