码迷,mamicode.com
首页 > Web开发 > 详细

Computer Networking: Network layer

时间:2018-08-14 17:52:48      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:mit   devices   replace   nano   boa   tee   str   update   and   

Forwarding and routing

2 important network-layer functions – forwarding and routing.

Forwarding: The router-local action of transferring a packet from an input link interface to the appropriate output link interface (within a single router).

Terms ‘forwarding’ and ‘switching’ are often used interchangeably.

Every router has a forwarding table. A router forwards a packet by examining the value of a field in the arriving packet’s header, and then using this header value to index into the router’s forwarding table. The value stored in the forwarding table entry for that header indicates the router’s outgoing link interface to which that packet is to be forwarded.

Routing: The network-wide process that determines the end-to-end paths that packets take from source to destination (involves all of a network’s routers).

 

Switches & routers

Packet switch: A general packet-switching device that transfer a packet from input link interface to output link interface, according to the value in a field in the header of the packet.

Link-layer switches: Packet switches that base their forwarding decision on values in the fields of the link layer frame. [layer 2 devices]

Routers: Packet switches that bases their forwarding decision on the value in the network layer field. [layer 3 devices]

 

Connection setup

Connection setup: The process of the routers along the chosen path from source to destination handshaking with each other in order to set up state before network-layer data packets can begin to flow.

Connection setup is an another important network-layer function required by some network-layer architectures. (e.g. ATM, frame relay, MPLS.)

 

 

Network service models

Network service model: defines the characteristics of end-to-end transport of packets between sending and receiving end systems.

Some possible services that the network layer could provide:

Guaranteed delivery; Guaranteed delivery with bounded delay; In-order packet delivery; Guaranteed minimal bandwidth; Guaranteed maximum jitter; Security services, etc.

技术分享图片

The Internet’s network layer provides a single service – best-effort service.

 

 

Virtual circuit and datagram network

A network layer can provide connection and connectionless services between 2 hosts, which have some parallels with transport-layer connection-oriented and connectionless services. The crucial differences are:

1) In the network layer, host-to-to services are provided by the network layer for the transport layer;

In the transport layer, process-to-process services are provided by the transport layer for the application layer.

2) In many major computer network architectures, the network layer provides either a host-to-host connectionless service or a host-to-host connection service, but not both.

3) The transport-layer connection-oriented service is implemented at the edge of the network in the end systems;

The network-layer connection service is implemented in the routers in the network core as well as in the end systems.

 

Virtual-circuit network and datagram network are 2 fundamental classes of computer networks.

Virtual-circuit (VC) networks: Computer networks that provide only a connection service at the network layer. E.g. ATM, frame relay.

Datagram networks: Computer networks that provide only a connectionless service at the network layer. E.g. The Internet.

 

 

Virtual-circuit networks

技术分享图片

 

Virtual circuits (VCs): Network-layer connections used in VC networks. A VC consists of (1) a path (a series of links and routers) between the source and destination hosts; (2) VC numbers, one number for each link along the path; (3) entries in the forwarding table in each router along the path.

Each router has number translation in its forwarding table, so that it can replace the VC number of each traversing packet with a new VC number according to the forwarding table.

Signaling messages: The message that the end systems send into the network to initiate or terminate a VC, and the messages passed between the routers to set up the VC.

Signaling protocols: The protocols used to exchange signaling messages.

 

e.g. The forwarding table in a VC network router:

技术分享图片

 

 

When a new VC is established across a router, an entry is added to the forwarding table;

When a VC terminates, the appropriate entries in each table along its path are removed.

Why a packet doesn’t just keep the same VC number on each of the links along its route?

1) To reduce the length of the VC field in the packet header;

2) To simplify VC setup (otherwise the routers have to exchange and process a substantial number of message to agree on a common VC number).

 

Each router must maintain connection state information for the ongoing connections.

 

3 phases in a VC:

1) VC setup:

The sending transport layer contacts the network layer, specifies the receiver’s address; ->

The network layer determines the path, and the VC number for each link along the path; ->

The network adds an entry in the forwarding table in each router along the path.

(The network layer may also reserve resources along the path.)

2) Data transfer:

Once the VC has been established, packets begin to flow along the VC.

3) VC teardown:

The sender or receiver informs the network layer of its desire to terminate the VC; ->

The network layer informs the end system on the other side of the call termination, and update the forwarding tables in each of the routers on the path to indicate that the VC no longer exists.

 

Distinction between the VC setup at the network layer and connection setup at the transport layer:

Transport-layer connection setup involves only the 2 end systems, only the 2 end systems are aware of the transport-layer connection.

Network-layer VC setup involves routers along the path, each router is aware of all the VCs passing through it.

 

 

Datagram networks

技术分享图片

 

In a datagram network, 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.

Each router has a forwarding table that maps destination address to link interfaces. When a packet arrives at a router, the router looks up the appropriate output link interface and forward the packet.

The router matches a prefix of the packet’s destination address with the entries in the table.

When there are multiple matches, the router uses the longest prefix matching rule – to choose the longest matching entry in the table.

e.g. The forwarding table in a datagram network router

技术分享图片

(Meaning: )

技术分享图片

 

 

 

Inside a router

 

技术分享图片

4 router components

Input ports:

Physical layer function – to terminate an incoming physical link at a router;

Link-layer functions – to interoperate with the link layer at the other side of the incoming link;

Lookup function – to use the forwarding table to determine the output port that an arriving packet will be forwarded via the switching fabric.

(Control packets: packets carrying routing protocol information, are forwarded from an input port to the routing processor.)

Switching fabric: through which that packets are switched from an input port to an output port.

Output ports: stores packet received from the switching fabric and transmit them on the outgoing link (by performing link-layer and physical layer functions).

When a link is bidirectional, an output port will typically be paired with the input port for that link on the same line card.

Line card: a printed circuit board containing one or more input ports, which is connected to the switching fabric.

Routing processor:

Executes the routing protocols;

Maintains (updates) routing tables and attached link state information;

Computes the forwarding table for the router;

Performs the network management functions.

 

The router forwarding plane functions (i.e. the forwarding functions of a router) are always implemented in hardware, because they must operate at the nanosecond time scale – far too fast for software implementation.

The router control plane functions (i.e. the control functions of a router) are always implemented in software, because they operate at the millisecond or second timescale.

 

Computer Networking: Network layer

标签:mit   devices   replace   nano   boa   tee   str   update   and   

原文地址:https://www.cnblogs.com/RDaneelOlivaw/p/9475935.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!