kl800.com省心范文网

计算机网络chapter5_图文


Chapter 5
The Network Layer

What is the job of the network layer? The network layer is concerned with getting packets from the source all the way to the destination. Getting to the destination may require making many hops (跳) at intermediate routers(中间路由器) along the way.
A
Sending message directly

Sending message indirectly

Sending message indirectly

Sending message indirectly

C

Sending message directly

B

Question: Does the data link layer do the same thing with the network? No, the data link layer just moves the frames from one end of a wire to the other. In order to get to the destination, the network layer needs to finish these 2 tasks: (1) The network layer must know about the topology of the communication subnet and choose appropriate paths through it. (2) The network layer must take care to choose routes to avoid overloading(使过载) some of the communication lines and routers while other idle.

5.1 Network Layer Design Issues
? ? ? ? ? Store-and-Forward(Page:20) Packet Switching Services Provided to the Transport Layer Implementation of Connectionless Service Implementation of Connection-Oriented Service Comparison of Virtual-Circuit and Datagram Subnets

5.1.1 Store-and-Forward Packet Switching(包交换)
fig 5-1

The environment of the network layer protocols.
Two important elements here: carrier’s equipment(shown inside the oval(椭 圆形 )) and customers’ equipment(shown outside the oval) carrier’s equipment(载波设备): routers connected by transmission lines customers’ equipment: such as personal computer

5.1.1 Store-and-Forward Packet Switching
Host H1 is directly connected to one of routers, A, by a leased line.

fig 5-1

H2 is on a LAN with a router, F owned and operated by the customer.

This router F also has a leased line to the carrier’s equipment.

Note: the F does not belong to the shaded oval.

The environment of the network layer protocols.

5.1.1 Store-and-Forward Packet Switching
fig 5-1
H1 transmits a packet to the nearest router, The packet is stored there until it has fully arrived so the checksum can be verified.

This mechanism is store-andforward packet switching.

Then it is forwarded to the next router along the path until it reaches the destination host

The environment of the network layer protocols.

5.1.2 Services Provided to the Transport Layer
The network layer services have been designed with the following goals in mind: 1. The services should be independent of the router technology, which means that routing technology is finished only in the network layer. 2. The transport layer does not need to know the number of the routers, type of the routers, and topology of the routers present. 3. The network addresses (the address here is different from the MAC address) should be available to the transport layer, and should use a uniform numbering plan, even across LANs and WANs. Except the above goals, there is still a problem needed to be discussed, it’s about whether the network should provide connectionless service or connection-oriented service, which introduces two kinds of network: Internet and ATM.

5.1.2 Services Provided to the Transport Layer
(1) Internet When the network layer provides connectionless service, packets are injected into the subnet individually and routed independently of each other. In this context, the packets are frequently called datagrams (in analogy with telegrams) and the subnet is called a datagram subnet. (2) ATM When the network layer provides connection-oriented service, a path from the source router to the destination router must be established before any data packets can be sent. This connection is called a VC (virtual circuit), and the subnet is called a virtual circuit subnet.

The Internet is an interconnected collection of many networks.

5.1.3 Implementation of Connectionless Service
Process P1 has a long message for P2.

The message is four times longer than the maximum packet size, so the network layer has to break it into four packets, 1, 2, 3, and 4. sends each of them in turn to router A using some point -to-point protocol Routing

within a diagram subnet.

5.1.3 Implementation of Connectionless Service

Each table entry is a pair consisting of a destination and the outgoing lines to use for that destination.

Every router has an internal table telling it where to send packets for each possible destination.

Note: Only directly-connected lines can be used.

Routing within a diagram subnet.

5.1.3 Implementation of Connectionless Service

Router A has only two outgoing lines—B and C– so every incoming packet must be sent to one of these routers. Even if the ultimate destination is some other router.

5.1.3 Implementation of Connectionless Service

As they arrived at A, packets 1, 2, and 3 were stored,Then each was forwarded to C according to A’s table. Packet 1 was then forwarded to E and then to F.

5.1.3 Implementation of Connectionless Service

Something different happened to packet 4. When it got to A it was sent to router B, even though it is also destined for F. The algorithm that manages the tables and makes the routing decision is called the routing algorithm.

5.1.4 Implementation of Connection-Oriented Service
What is the idea of virtual circuit? When a connection is established, a route from the source machine to the destination machine is chosen as part of the connection setup and stored in tables inside the routers. The route is used for all traffic flowing over the connection, exactly the same way that the telephone system works. When the connection is released, the virtual circuit is also terminated.

5.1.4 Implementation of Connection-Oriented Service

Routing within a virtual-circuit subnet.

5.1.4 Implementation of Connection-Oriented Service

Host H1 has established connection 1 with host H2. It is remembered as the first entry(第一项) in each of the routing tables. The first line of A’s table says that if a packet bearing connection identifier 1 comes in from H1, it is to be sent to router C and given connection identifier 1.

5.1.4 Implementation of Connection-Oriented Service

Similarly, the first entry at C routes the packet to E, also with connection identifier 1. If H3 also wants to establish a connection to H2. It chooses connection identifier 1 (because it is initiating the connection and this is its only connection) and tells the subnet to establish the virtual circuit. This leads to the second row in the tables.

5.1.4 Implementation of Connection-Oriented Service

We have a conflict here because although A can easily distinguish connection 1 packets from H1 from connection 1 packets from H3, C cannot do this. For this reason, A assigns a different connection identifier to the outgoing traffic for the second connection.

5.1.5 Comparison of Virtual-Circuit and Datagram Subnets

5-4

数据报服务和虚电路服务 优缺点的归纳
对比的方面
思路 连接的建立

虚电路服务
可靠通信应当 由网络来保证 必须有

数据报服务
可靠通信应当 由用户主机来保证 不要

目的站地址

仅在连接建立阶段 使用,每个分组使 用短的虚电路号

每个分组都有 目的站的全地址

数据报服务和虚电路服务 优缺点的归纳
对比的方面
分组的转发

虚电路服务
属于同一条虚电路 的分组均按照同一 路由进行转发 所有通过出故障的 结点的虚电路 均不能工作

数据报服务
每个分组独立选择 路由进行转发 故障结点可能丢失 分组,一些路由 可能会发生变化

当结点出 故障时

数据报服务和虚电路服务 优缺点的归纳
对比的方面
分组的顺序 端到端的 差错处理和 流量控制

虚电路服务
总是按发送顺序 到达目的站 可以由分组交换网 负责也可以由用户 主机负责

数据报服务
到达目的站时不一定 按发送顺序 由用户主机负责

5.6 THE NETWORK LAYER IN THE INTERNET
Design Principles for Internet
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Make sure it works.(保证互联网能工作) Keep it simple.(尽量简单) Make clear choices.(选择要清晰) Exploit modularity.(模块化) Expect heterogeneity.(支持异构性) Avoid static options and parameters.(避免不变的选项及参数) Look for a good design; it need not be perfect.(寻找好的设计方 案,不需要完美) Be strict when sending and tolerant when receiving.(发送时要精 确,接收时要宽容) Think about scalability.(考虑可扩展性) Consider performance and cost.(考虑性能与功耗)

5.6 THE NETWORK LAYER IN THE INTERNET
At the network layer, the Internet can be viewed as a collection of subnetworks or Autonomous Systems (ASes,自治系统) that are interconnected.

The Internet is an interconnected collection of many networks.

There is no real structure, but several major backbones exist. These are constructed from high-bandwidth lines and fast routers. Attached to the backbones are regional network. Attached to these regional networks are the LANs at many universities, companies, and Internet service providers.

5.6 THE NETWORK LAYER IN THE INTERNET
1. What is IP? The glue(胶水) that holds the whole Internet together is the network layer protocol, IP (Internet Protocol). It was designed from the beginning with internetworking in mind. Its job is to provide a best-efforts way to transport datagrams from source to destination. 2. Communication in the Internet The transport layer takes data streams and breaks them up into datagrams. Each datagram is transmitted through the Internet, possibly being fragmented into smaller units as it goes. When all the pieces finally get to the destination machine, they are reassembled by the network layer into the original datagram.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header.

位 固 定 首 部 部 分

0

4 标 生存时间

8 区分服务 识 协 议

16 标志 源 地 址

19

24 总 长 度 片 偏 移

31

版 本 首部长度

首 部 检 验 和

可变 部分

目 的 地 址
可 选 字 段 (长 度 可 变) 数 据 数 据 部 部 分 分 填 充

传送

首 部

IP 数据报
发送在前

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. An IP datagram consists of a header part and a text part. The header has a 20-byte fixed part and a variable length optional part (长度可变的可选部分).

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The version field means the version of the protocol the datagram belongs to, such as IPv4.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. IHL is provided to tell how long the header is, in 32-bit words. The minimum value is 5, which applies when no options are present. The maximum value of this 4-bit field is 15, which limits the header to 60 bytes, and thus the options field to 40 bytes.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The Type of service field is one of the few fields that has changed its meaning over the years. It was and is still intended to distinguish between different classes of service. Eventually, IETF accommodated differentiated services.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The total length including everything in the datagram, both the header and data. The maximum length is 65,535 bytes. At present, this upper limit is tolerable(还可以接受), but with future gigabit network, larger datagrams may be needed.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The Identification field is needed to allow the destination host to determine which datagram a newly arrived fragment belongs to. All the fragments of a datagram contain the same Identification value.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. DF stands for Don’t Fragment. It is an order to the routers not to fragment the datagram because the destination is incapable of putting the pieces back together again.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. By marking the datagram with DF bit, the sender knows it will arrive in one piece.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. MF stands for More Fragments. All fragments except the last one have this bit set to binary 1. It is needed to know when all fragments of datagram have arrived.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The Fragment offset tells where in the current datagram this fragment belongs. All fragments except the last one in a datagram must be a multiple of 8 bytes, the elementary fragment unit. Since 13 bits are provided, there is a maximum of 8192 fragments per datagram.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. 片偏移(12 位)指出:较长的分组在分片后某片在原分组中 的相对位置。片偏移以 8 个字节为偏移单位。

IP 数据报分片的举例
需分片的 数据报 数据部分共 3800 字节

首部
字节 0 1400 2800

偏移 = 0/8 =0

3799

首部 1 字节 0
数据报片 1 偏移 = 0/8 = 0 1399

首部 2
1400 数据报片 2 偏移 = 1400/8 = 175 2799

首部 3
2800 数据报片 3 偏移 = 2800/8 = 350 3799

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The Time to live field is a counter used to limit packet lifetime. It is supposed to count time in seconds, allowing a maximum lifetime of 255 sec. It must be decremented on each hop. When it hits zero, the packet is discard and a warning packet is sent back to source host.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The protocol field tells it which transport process to give it to. TCP is one possibility, but so are UDP.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The Header checksum verifies the header only. Such a checksum is useful for detecting errors generated by bad memory works inside a router.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. Note that the header checksum must be recomputed at each hop because at least one field always changes.

5.6 1 The IP Protocol

The IPv4 (Internet Protocol) header. The source address and destination address indicate the network number (net-id) and host number (host-id).

5.6.2 IP Addresses
Every host and router on the Internet has an IP address, which encodes its network number and host number. The combination is unique: in principle, no two machines on the Internet have the same IP address. Network numbers are managed by a nonprofit corporation(非 盈利性组织) called ICANN (Internet Corporation for Assigned Names and Numbers) to avoid conflicts.

5.6.2 IP Addresses

All IP addresses are 32 bits long and are used in the source address and Destination address fields of IP packets. It is important to note that an IP address does not actually refer to a host. It really refers to a network interface, so if a host is on two network, it must have two IP addresses.

5.6.2 IP Addresses
IP address were divided into the five categories(类) listed in figure below. This allocation has come to be called classful addressing(分类地址). It is no longer used.

IP address formats.

5.6.2 IP Addresses
Class A 0 net-id 8位 Class B 10 host-id 24 位

net-id 16 位 Class C
110 net-id 24 位

host-id 16 位

host-id 8位 多播地址

Class D

1110

Class E

1111

保留为今后使用

5.6.2 IP Addresses
The steps for routing: (1)Searching for the net-id in the network which is adapted to the net-id in the IP address.

(2)When the packets arrived in the destination network, directly send to destination host according to the host-id. So when we divided the IP address into net-id and host-id, the net-id can be extracted from the packet quickly in the router.

5.6.2 IP Addresses
1. Written format Network addresses, which are 32-bit numbers, are usually written in dotted decimal notation (点分十进制). In this format, each of the 4 bytes is written in decimal, from 0 to 255. The lowest IP address is 0.0.0.0 and the highest 255.255.255.255. 2. Special IP address

Special IP addresses.

5.6.2 IP Addresses
3. subnets All the hosts in a network must have the same network number.

5.6.2 IP Addresses
The hosts and router in the same LAN must has the same net-id。
222.1.1.1 LAN1 222.1.1. LAN3 222.1.3.3 222.1.3. 222.1.1.2

222.1.1.3

R1 222.1.5.1

222.1.1.4 222.1.6.1 N3 222.1.6. LAN2 222.1.2.

222.1.2.1

222.1.5.2
222.1.3.1 R3

N2 222.1.5.

222.1.6.2 222.1.2.5 N1 222.1.4. R2

222.1.2.2

222.1.3.2

222.1.4.2

222.1.4.1

B

互联网

222.1.2.4 222.1.2.3

A router always has two or more IP 5.6.2 IP Addresses addresses. While every interface of a router only has an IP address.
222.1.1.1 222.1.1.2

222.1.1.3

LAN1 222.1.1. LAN3 222.1.3.3 222.1.3.

R1 222.1.5.1

222.1.1.4 222.1.6.1 N3 222.1.6. LAN2 222.1.2.

222.1.2.1

222.1.5.2
222.1.3.1 R3

N2 222.1.5.

222.1.6.2 N1 222.1.4. R2 222.1.2.5

222.1.2.2

222.1.3.2

222.1.4.2

222.1.4.1

B

互联网

222.1.2.4 222.1.2.3

5.6.2 IP Addresses
1) difference of the subnet and the subnets In the Internet literature, the parts of the network (in this case, Ethernet) are called subnets. As we mentioned in Chap. 1, this usage conflicts with ‘subnet’ to mean the set of all routers and communication lines in a network.

5.6.2 IP Addresses
2) function of the subnets When a packet comes into the main router, how does it know which subnet (Ethernet) to give it to? Taking Class B for example.

A campus network consisting of LANs for various departments.

5.6.2 IP Addresses

A campus network consisting of LANs for various departments. One way would be to have a table with 216 entries in the main router telling which router to use for each host on campus. This idea would work, but it would require a very large table in the main router and a lot of manual maintenance as hosts were added, moved, or taken out of service.

5.6.2 IP Addresses
Instead, as class B has 14 bits for the network number and 16 bits for the host number, some bits are taken away from the host number to create a subnet number. For example, if the university has 35 departments, it could use a 6-bit subnet number and 10-bit host number, allowing for up to 64 Ethernets, each with a maximum of 1022 hosts (0 and all 1s are not available, as mentioned earlier). 3) subnet mask To implement subnetting, the main router needs a subnet mask that indicates the split between network+subnet number and host.

5.6.2 IP Addresses

A class B network subnetted into 64 subnets. Subnet masks are also written in dotted decimal notation, with the addition of a slash followed by the number of bits in the network+subnet part. In the figure above, the subnet mask can be written as 255.255.252.0. An alternative notation is /22 to indicate that the subnet mask is 22 bits long.


计算机网络chapter5_图文.ppt

计算机网络chapter5 - Chapter 5 The Network La

计算机网络高级教程chapter5_图文.ppt

计算机网络高级教程chapter5 - Chapter 5 The Networ

计算机网络 清华大学出版社chapter5_图文.ppt

计算机网络 清华大学出版社chapter5 - 实验二安排 ? ? ? 11月8

计算机网络Chapter5_nov15_05_图文.ppt

计算机网络Chapter5_nov15_05 - Chapter 5 Link

山东大学计算机网络课件Chapter5_图文.ppt

山东大学计算机网络课件Chapter5 - Chapter 5 The Netw

计算机网络_Chapter_5要点_图文.ppt

计算机网络_Chapter_5要点 - OSI 网络层 网络基础第五章 学习

计算机网络英文课件Chapter5_图文.ppt

计算机网络英文课件Chapter5 - 计算机网络英文课件 华东师范大学... 计算机网络英文课件Chapter5_工学_高等教育_教育专区。计算机网络英文课件华东师范大学 ...

计算机网络Chapter5-cut_图文.ppt

计算机网络Chapter5-cut - Chapter 5: The Data

计算机网络自顶向下方法与Internet特色(第三版)chapter5_图文....ppt

计算机网络自顶向下方法与Internet特色(第三版)chapter5 - Chapter 5 The Data Link Layer Our goals: ? understand pri...

武汉大学国际软件学院计算机网络课件Chapter5_4thed_图文.ppt

武汉大学国际软件学院计算机网络课件Chapter5_4thed_工学_高等教育_教育专区。武汉大学国际软件学院计算机网络课件 Chapter 5 Link Layer and LANs Computer Networking...

计算机网络 Chapter_5_V6.01_图文.ppt

计算机网络 Chapter_5_V6.01 - Chapter 5 Link L

计算机网络 清华大学出版社chapter5 - 预习版_图文.ppt

计算机网络 清华大学出版社chapter5 - 预习版_理学_高等教育_教育专区。Computer Communication Networks Chapter 5 The Network Layer Chen Yu-feng 陈宇峰 Hubei ...

计算机网络课件chapter 5a_图文.ppt

计算机网络课件chapter 5a - Chapter 5: The Data

计算机网络chapter5_图文.ppt

计算机网络chapter5 - Chapter 5. The Network L

计算机网络自顶向下第4版课件--Chapter5_图文.ppt

计算机网络自顶向下第4版课件--Chapter5_理学_高等教育_教育专区。计算机网络自顶向下 第4版 课件 Chapter 5 Link Layer and LANs A note on the use of ...

计算机视觉Chapter5_图文.ppt

计算机视觉Chapter5_计算机硬件及网络_IT/计算机_专业资料。计算机视觉Chapter5,计算机视觉,计算机视觉就业怎么样,计算机视觉与机器视觉的区别,计算机视觉招聘,计算机视觉...

计算机网络 Chapter5_图文.ppt

计算机网络 Chapter5 - Chapter 5 Link Layer an

计算机网络_Chapter_5.ppt

新闻网页贴吧知道音乐图片视频地图百科文库 搜 试试 7 帮助 全部 DOC PPT TXT...计算机网络_Chapter_5_电脑基础知识_IT/计算机_专业资料。OSI 网络层 网络基础...

东大信息网络概论chapter5_图文.pdf

东大信息网络概论chapter5_互联网_IT/计算机_专业资料。Chapter 5 The Network Layer 2016 Edition Copyright by X Y Chen,SISE Network Layer Design Issues ? ?...

哈工大计算机网络chapter5a_图文.ppt

哈工大计算机网络chapter5a - Chapter 5: The Data