60
DNT 1013 DATA COMMUNICATIONS ------------------------------- ----------- CHAPTER 4: NETWORK LAYER Prepared By: Mdm Noor Suhana Bt Sulaiman FKMT-NT, TATiUC

DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

  • Upload
    asta

  • View
    53

  • Download
    3

Embed Size (px)

DESCRIPTION

DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER. Prepared By: Mdm Noor Suhana Bt Sulaiman FKMT-NT, TATiUC. NETWORK LAYER: LOGICAL ADDRESSING. OSI Layers – Network Layer. The Network Layer - PowerPoint PPT Presentation

Citation preview

Page 1: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

DNT 1013DATA COMMUNICATIONS

------------------------------------------CHAPTER 4:

NETWORK LAYER

Prepared By:Mdm Noor Suhana Bt SulaimanFKMT-NT, TATiUC

Page 2: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

NETWORK LAYER:LOGICAL ADDRESSING

Page 3: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

OSI Layers – Network LayerThe Network LayerPerforms network routing, flow

control, segmentation, and error control functions

The router operates at this layerUses local addressing scheme Example – IP, token ring

Page 4: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Network LayerConcerned 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).

Page 5: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Network Layer Design Goals1. The services provided by the network layer

should be independent of the subnet topology.2. The Transport Layer should be shielded from

the number, type and topology of the subnets present.

3. The network addresses available to the Transport Layer should use a uniform numbering plan (even across LANs and WANs).

Page 6: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Physicallayer

Data linklayer

Physicallayer

Data linklayer

End system

Networklayer

Physicallayer

Data linklayer

Physicallayer

Data linklayer

Transportlayer

Transportlayer

MessagesMessages

Segments

End system

Networkservice

Networkservice

Networklayer

Networklayer

Networklayer

Page 7: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Application

Transport

InternetNetwork Interface

Application

Transport

InternetInternet

Network 1 Network 2

Machine A Machine B

Router/Gateway

Network Interface

Network Interface

Page 8: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Packet 2

Packet 1

Packet 1

Packet 2

Packet 2

Datagram Packet Switching

Page 9: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Destinationaddress

Outputport

1345 12

2458

70785

6

12

1566

Routing Tablein Datagram Network

Page 10: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

IP (Internet Protocol) is a Network Layer Protocol.

IP’s current version is Version 4 (IPv4). It is specified in RFC 891.

NetworkLayer

Link Layer

IP

ARPNetworkAccess

Media

ICMP IGMP

TransportLayer

TCP UDP

Orientation

Page 11: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Application protocol IP is the highest layer protocol which is

implemented at both routers and hosts Application

TCP

IP

Data Link

Application

TCP

IP

NetworkAccess

Application protocol

TCP protocol

IP protocol IP protocol

DataLink

DataLink

IP

DataLink

DataLink

IP

DataLink

DataLink

DataLink

IP protocol

RouterRouter HostHost

Page 12: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

IP Service Delivery service of IP is minimal IP provide 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

Page 13: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

IP supports the following services: one-to-one (unicast) one-to-all (broadcast) one-to-several (multicast)

IP multicast also supports a many-to-many service. IP multicast requires support of other protocols (IGMP,

multicast routing)

IP Service

unicastbroadcast multicast

Page 14: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

NETWORK LAYER:ADDRESS MAPPING,

ERROR REPORTING & MULTICASTING

Page 15: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Address MappingThe delivery of a packet to a host or a router

requires two levels of addressing: logical and physical.

We need to be able to map a logical address to its corresponding physical address and vice versa.

This can be done by using either static or dynamic mapping.

Page 16: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.1 ARP operation

Page 17: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.2 ARP packet

Page 18: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.3 Encapsulation of ARP packet

Page 19: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.4 Four cases using ARP

Page 20: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

An ARP request is broadcast;an ARP reply is unicast.

Page 21: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.5 ARP request packet & reply

Page 22: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.6 Proxy ARP

Page 23: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

DHCP provides static and dynamic address allocation that can be

manual or automatic.

Page 24: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

ICMPThe IP protocol has no error-reporting or

error-correcting mechanism. The IP protocol also lacks a mechanism for

host and management queries. The Internet Control Message Protocol

(ICMP) has been designed to compensate for the above two deficiencies.

It is a companion to the IP protocol

Page 25: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.7 General Format of ICMP Message

Page 26: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

ICMP always reports error messages to the original source.

Page 27: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.8 Error Reporting Message

Page 28: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Important points about ICMP error messages:❏ No ICMP error message will be generated in response to a datagram carrying an ICMP error message.❏ No ICMP error message will be generated for a fragmented datagram that is not the first fragment.❏ No ICMP error message will be generated for a datagram having a multicast address.❏ No ICMP error message will be generated for a datagram having a special address such as 127.0.0.0 or 0.0.0.0.

Page 29: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.9 Content of data field for error message

Page 30: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

We use the ping program to test the server fhda.edu. The result is shown on the next slide. The ping program sends messages with sequence numbers starting from 0. For each probe it gives us the RTT time. The TTL (time to live) field in the IP datagram that encapsulates an ICMP message has been set to 62. At the beginning, ping defines the number of data bytes as 56 and the total number of bytes as 84. It is obvious that if we add 8 bytes of ICMP header and 20 bytes of IP header to 56, the result is 84. However, note that in each probe ping defines the number of bytes as 64. This is the total number of bytes in the ICMP packet (56 + 8).

Example 21.3

Page 31: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER
Page 32: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.10 Traceroute program operation

Page 33: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

We use the traceroute program to find the route from the computer voyager.deanza.edu to the server fhda.edu. The following shows the result:

The unnumbered line after the command shows that the destination is 153.18.8.1. The packet contains 38 bytes: 20 bytes of IP header, 8 bytes of UDP header, and 10 bytes of application data. The application data are used by traceroute to keep track of the packets.

Page 34: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

ICMPv6Another protocol that has been modified in

version 6 of the TCP/IP protocol suite is ICMP (ICMPv6).

This new version follows the same strategy and purposes of version 4.

Page 35: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.11 Comparison of network layer between IPv4 and IPv6

Page 36: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Table 21.3 Comparison of error-reporting messages in ICMPv4 and ICMPv6

Page 37: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Table 21.4 Comparison of query messages in ICMPv4 and ICMPv6

Page 38: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

IP AddressAn IP address is a unique number that is used to identify

a network device.An IP address is represented as a 32-bit binary number,

divided into four octets (groups of eight bits):Example: 10111110.01100100.00000101.00110110

An IP address is also represented in a dotted decimal format.Example: 190.100.5.54

When a host is configured with an IP address, it is entered as a dotted decimal number, such as 192.168.1.5.

Unique IP addresses on a network ensure that data can be sent to and received from the correct network device.

Page 39: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

IP Address ClassesClass A

Large networks, implemented by large companies and some countries

Class BMedium-sized networks, implemented by universities

Class CSmall networks, implemented by ISP for customer

subscriptionsClass D

Special use for multicastingClass E

Used for experimental testing

Page 40: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.12 Mapping class D to Ethernet physical address

Page 41: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

An Ethernet multicast physical address is in the range

01:00:5E:00:00:00 to 01:00:5E:7F:FF:FF.

Page 42: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 21.22 Tunneling

Page 43: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

We use netstat (see next slide) with three options: -n, -r, and -a. The -n option gives the numeric versions of IP addresses, the -r option gives the routing table, and the -a option gives all addresses (unicast and multicast). Note that we show only the fields relative to our discussion. “Gateway” defines the router, “Iface” defines the interface.

Note that the multicast address is shown in color. Any packet with a multicast address from 224.0.0.0 to 239.255.255.255 is masked and delivered to the Ethernet interface.

Example 21.9

Page 44: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Example 21.9..cont..

Page 45: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

NETWORK LAYER:DELIVERY, FORWARDING &

ROUTING

Page 46: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

RoutingRouting algorithm:: that part of the Network

Layer responsible for deciding on which output line to transmit an incoming packet.Remember: For virtual circuit subnets the routing decision is made ONLY at set up.

Algorithm properties:: correctness, simplicity, robustness, stability, fairness, optimality, and scalability.

Page 47: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Routing ClassificationAdaptive Routing

based on current measurementsof traffic and/or topology.

1. centralized2. isolated3. distributed

Non-Adaptive Routing

1. flooding

2. static routing using shortest path algorithms

Page 48: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Shortest Path Routing1. Bellman-Ford Algorithm [Distance Vector]2. Dijkstra’s Algorithm [Link State]

What does it mean to be the shortest (or optimal) route?

a. Minimize mean packet delayb. Maximize the network throughputc. Mininize the number of hops along the path

Page 49: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Internetwork Routing [Halsall]

Adaptive Routing

Centralized Distributed

Intradomain routing Interdomain routing

Distance Vector routing Link State routing

[IGP] [EGP]

[BGP,IDRP]

[OSPF,IS-IS,PNNI][RIP]

[RCC]

InteriorGateway Protocols

ExteriorGateway Protocols

Page 50: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Distance Vector RoutingHistorically known as the old ARPANET routing

algorithm {or known as Bellman-Ford algorithm}.

Basic idea: each network node maintains a Distance Vector table containing the distance between itself and ALL possible destination nodes.

Distances are based on a chosen metric and are computed using information from the neighbors’ distance vectors.

Metric: usually hops or delay

Page 51: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Distance Vector Routing Information kept by DV router

1. each router has an ID2. associated with each link connected to a

router, there is a link cost (static or dynamic) the metric issue!

Distance Vector Table Initialization

Distance to itself = 0

Distance to ALL other routers = infinity number

Page 52: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Distance Vector Algorithm1. Router transmits its distance vector to each of its

neighbors.2. Each router receives and saves the most recently

received distance vector from each of its neighbors.

3. A router recalculates its distance vector when:a. It receives a distance vector from a neighbor

containing different information than before.b. It discovers that a link to a neighbor has gone

down (i.e., a topology change).The DV calculation is based on minimizing the cost to each destination.

Page 53: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Distance Vector Routing

Figure 5-9.(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.

Page 54: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Routing Information Protocol (RIP)RIP had widespread use because it was

distributed with BSD Unix in “routed”, a router management daemon.

RIP is the most used Distance Vector protocol.RFC1058 in June 1988.Sends packets every 30 seconds or faster.Runs over UDP.Metric = hop countBIG problem is max. hop count =16

RIP limited to running on small networks!!Upgraded to RIPv2

Page 55: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Link State Algorithm1. Each router is responsible for meeting its

neighbors and learning their names.2. Each router constructs a link state packet (LSP)

which consists of a list of names and cost to reach each of its neighbors.

3. The LSP is transmitted to ALL other routers. Each router stores the most recently generated LSP from each other router.

4. Each router uses complete information on the network topology to compute the shortest path route to each destination node.

Page 56: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Open Shortest Path First(OSPF)OSPF runs on top of IP, i.e., an OSPF packet is

transmitted with IP data packet header.Uses Level 1 and Level 2 routersHas: backbone routers, area border routers,

and AS boundary routersLSPs referred to as LSAs (Link State

Advertisements)Complex algorithm due to five distinct LSA

types.

Page 57: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Area 0.0.0.1Area 0.0.0.2

Area 0.0.0.3

R1

R2

R3

R4 R5

R6 R7

R8

N1

N2

N3

N4

N5

N6

N7

To another AS

Area 0.0.0.0

R = router N = network

OSPF Areas

Page 58: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Figure 5-65.The relation between ASes, backbones, and areas in OSPF.

Page 59: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

Border Gateway Protocol (BGP)

The replacement for EGP is BGP. Current version is BGP-4.

BGP assumes the Internet is an arbitrary interconnected set of AS’s.

In interdomain routing the goal is to find ANY path to the intended destination that is loop-free. The protocols are more concerned with reachability than optimality.

Page 60: DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 4: NETWORK LAYER

And one truly last word…

ThAnKs