文章目录
Reference:
- Computer Networking:A Top-Down Approach,7-th
- PPT of NEU(lx)
1.0、相关术语 (Terms)
En | Ch | En | Ch |
---|---|---|---|
LAN | 局域网 | WAN | 广域网 |
Router | 路由器 | Switch | 交换机 |
Protocol | 协议 | Packet | 报文 |
ISP | 因特网服务提供商 | TCP | 传输控制协议 |
UDP | 用户数据报协议 | Bandwidth | 带宽 |
Infrastructure | 基础设施 | Ethernet | 以太网 |
Multiplexing | 多路复用 | Encapsulation | 封装 |
Stack | 栈 | FDM | 频分复用 |
TDM | 时分复用 | Congestion | 拥挤,阻塞 |
Intranet | 内网 | Extranet | 外网 |
1.1、什么是互联网
计算机网络概念:
一般地说,将分散的多个计算机、终端和外部设备用通信线路
互联
起来,彼此间实现互相通信,并且计算机的硬件、软件和数据资源都可以共同使用,实现资源共享
的整个系统就叫做计算机网络
。计算机网络就是互连(互联互通)的、自治(无主从关系)的(autonomous)计算机集合。
计算机网络=通信技术+计算机技术。
计算机网络由以下成分组成:
- 硬件:
- 终端系统
End system
:主机,PC、客户端、服务器、工作站等; - 中间系统
Intermediate System
:让终端系统构成通信的系统,包括路由器、交换机等; - 接口:网络接口卡
Network interface card,NIC
,Modem; - 物理媒体
Medium
:同轴电缆Coaxial cable
、双绞线Twisted pair
、光纤、无线等。
- 终端系统
- 软件:
- 协议:TCP/IP、CSMA/CD、UDP、PPP、ATM等;
- 应用:HTTP、SMTP、FTP、Telnet等。
计算机网络的分类:
-
拓扑分类:
-
总线拓扑
Bus Topology
:所有设备连接到同一个总线:
-
星形、树形拓扑
Star & Tree Topology
:星形拓扑所有终端通过同一个结点通信,容易导致该结点压力过大。
而树形拓扑则是星形的嵌套拓展,通过交换机、路由器和桥等可以实现帧过滤和包过滤,能够有效降低核心结点压力。
-
环拓扑
Ring Topology
:帧按照环路顺时针或者逆时针传递:
环拓扑可以拓展为双环结构。双环可以反向传播,从而有效避免单个结点事故导致整个网络瘫痪。
-
-
规模
scale
分类:- 局域网
LAN
:在一个比较小的地理区域内,一组计算机实现的通信线路和无线连接; - 广域网
WAN
:由地理上比较分散的电信网络构成,是LAN
的对外拓展; - 国际互联网
Internet
:由许多局域网无限形成的一个世界范围的计算机网络。
- 局域网
-
范围分类:
- 内网
Intranet
:一般是企业的私有网络,它可以由许多互连的局域网构成,也可以在广域网中使用租赁线路; - 外网
Extranet
:外网指私有网络通过互联网技术和公共通信系统来安全地共享资源和信息从而形成的网络;外网可以看做是公司内网的一部分,扩展到公司以外的用户;它也被描述为一种“精神状态”,互联网被认为是与其他公司做生意以及向客户销售产品的一种方式。
- 内网
什么是互联网Internet
?
组成细节角度Nuts and bolts view
:
Internet
是Network of networks
,是由大量的局域网形成的国际网络,具有松散分层的特点。
-
全球最大的互联网络Internet
-
ISP网络互联的“网络之网络”
- 众多互联的计算机设备:
- 主机
hosts
=端系统end system
; - 运行各种网络应用;
- 主机
- 通信线路:光纤、铜缆、无线电、卫星等。
- 分组交换:转发分组(数据包)
- 路由器
Routers
和交换机Swithes
- 路由器
- 众多互联的计算机设备:
-
A packet passes through many networks
-
ISP
-
“tier-1” ISPs (MCI, Sprint, AT&T, Cable and Wireless), national/international coverage
-
treat each other as equals
-
-
“tier-2” ISPs
-
Connect to one or more tier-1 ISPs, possibly other tier-2 ISPs
-
-
“tier-3” ISPs
- Last hop (“access”) network (closest to end systems)
-
-
-
协议:控制、发送和接收报文,e.g. TCP、IP、HTTP等;
-
Internet是网络的网络:松散分层
-
网络标准
Internet Standards
:- 请求评论文档
Request for comments,RFC
:改进标准; - Internet工程任务组
Internet Engineering Task Force,IETF
:公布标准。
- 请求评论文档
服务角度:
-
为网络应用提供通信服务的通信基础设施
communication infrastructure
:让互联网实现分布式的应用,例如:Web、E-Mail等; -
为网络应用提供应用编程接口(API)
- 支持应用程序"连接"Intenet,发送/接收数据;
- 提供类似于邮政系统的数据传输服务;
-
供给应用程序的通信服务:
- 无连接
Connectionless
、不可靠unreliable
的服务; - 面向连接
Connection-oriented
、可靠reliable
的服务。
- 无连接
什么是协议Protocol
?
所有的网络通信都需要受到协议的控制。协议的定义及作用如下:
网络协议是为进行网络中的数据交换而建立的规则、标准或约定,协议
Protocol
定义了在网络实体间发送和接收的消息的格式、顺序,以及当这个消息被发送和接收时所需要采取的行为。协议规范了网络中所有信息发送和接收过程。
协议的三要素?
-
语法(Syntax)
- 数据与控制信息的结构或格式
- 信号电平
-
语义(Semantics)
- 需要发出的何种控制信息
- 完成何种动作以及做出何种相应
- 差错控制
-
时序(Timing)
-
事件顺序
-
速度匹配
-
1.2、互联网发展史
略
1.3、 网络体系结构
网络的体系结构主要分为网络边缘Network edge
、网络核心Network core
、接入网络access networks
以及物理媒体physical media
四个部分。
网络边缘主要包括主机和一些在主机上运行的应用,网络核心主要包含一些路由器(转发设备),以及由这些路由器的网络(网状网络),而接入网络和物理媒体则构成了通信的线路。
1.3.1、网络边缘 (Network Edge)
网络边缘最主要的就是终端系统End systems
,也就是主机hosts
以及主机上运行的网络应用(浏览器、E-Mail等)。
在终端系统上提供服务主要采用以下模型:
-
客户端/服务器模型
client/server model
:由客户端主机请求和接收来自长期启动的服务器always-on server
的服务,例如Web应用、文件传输FTP应用等。 -
对等模型
peer-peer model
:尽可能少或者不使用专用服务器,通信的双方都具有双重的身份,(既可以是客户端,也可以是服务器),通信在对等实体之间直接进行,例如Skype、KaZaA、QQ等
网络边缘提供的服务主要包含以下两种:
-
面向连接服务
connection-oriented service
:- 连接:两个对等实体进行数据通信而进行的一种结合;
- 过程或阶段:建立连接、数据传输、释放连接;
- 目的:实现终端间的数据传输;
- 握手
handshaking
:在进行数据传输之前所需要进行的准备过程,其主要内容为在通信的主机间建立状态set up state
; - 传输控制协议
Transmission Control Protocol,TCP
:典型的面向连接互联网服务。- 可靠的、有序的字节流传输服务;
- 如果出现了数据丢失
loss
,则进行确认acknowledgements
和重传retransmissions
。接收端对接收的内容进行确认,而发送端则在接收端确认以后对丢失的数据进行重传; - 流控制
flow control
:发送端不会淹没overwhelm
接收端; - 拥塞控制
congestion control
:发送端会在网络拥塞时降低发送速度。
-
无连接服务
connectionless service
:- 特征:
- 两个实体之间的通信不需要事先建立好一个连接,所以没有准备过程;
- 由于没有准备过程,其下层的相关资源无需预定保留,而采用动态分配策略;
- 两个实体并不一定同时处于活跃状态;
- 没有流控制和拥塞控制;
- 尽最大努力交付数据
best effort delivery
,而不关心是否成功; - 不能防止报文丢失、重复和失序,是一种不可靠服务。
- 如手机短信通信。
- 目的:实现终端间的数据传输;
- 用户数据报协议
User Datagram Protocol,UDF
:- 无连接、不可靠的数据传输;
- 没有流控制和拥塞控制。
- 特征:
1.3.2、网络核心 (Network Core)
- 网络核心是互联
interconnected
的路由器的有机组合mesh
。 - 网络核心的关键功能:路由
Routing
+转发Forwarding
。
-
网络核心解决的基本问题:如何实现数据从源主机通过网络核心送达目的主机?
-
在网络核心,数据的转发主要有两种方式:
-
电路交换
circuit-switching
:每次通信都需要建立专门的电路;-
对于每一个通信提供端到端的资源预留(带宽、交换机处理能力)
- 专用资源(非共享)
- 一定程度上的通信性能保障
- 需要通信建立阶段
-
必须是面向连接的
-
通话/通信的全部时间内,通话的两个用户始终占用端到端的固定传输带宽
-
使用电路交换来传输计算机数据时,线路的传输效率往往很低
-
网络资源划分为"片"
-
复用
Multiplexing
-
如何划分?
-
频分复用
FDM
(实例:调频广播) -
时分复用
TDM
时分复用可能会造成线路资源的浪费:
统计时分复用
STDM
: -
码分复用
CDMA
-
-
Question:
线路带宽为
1.536Mbps
,以规模为24slots/sec
的TDM
进行划分,建立连接需要500msec
。则多久可以传输完大小为640Kb
的文件?解:划分为24片则每片带宽 b w i = 1.536 M b p s 24 = 1536 K b p s 24 = 64 K b p s bw_i=\frac{1.536Mbps}{24}=\frac{1536Kbps}{24}=64Kbps bwi=241.536Mbps=241536Kbps=64Kbps。则传输时间 T t r a n = 640 K b b w i = 10 s T_{tran}=\frac{640Kb}{bw_i}=10s Ttran=bwi640Kb=10s。所以总耗时 T = T t r a n + T c o n n e c t = 10 s + 0.5 s = 10.5 s T=T_{tran}+T_{connect}=10s+0.5s=10.5s T=Ttran+Tconnect=10s+0.5s=10.5s。
将上提转换为以规模为
24channels/frequencies
的FDM
进行划分,则需要多长时间?解:每片带宽 b w i = 64 K b p s bw_i=64Kbps bwi=64Kbps,则传输时间仍然为 T t r a n = 10 s T_{tran}=10s Ttran=10s,所以总耗时也是 T = 10.5 s T=10.5s T=10.5s。
-
-
-
分组交换
packet-switching
:所有数据在传输的过程中被划分为离散的“数据块”,而不关心每个数据块的传输过程。-
共享网络资源
-
使用链路全部带宽
-
按需使用
-
资源竞争:
- 总资源需求可能超过可用数量
- 拥塞
Congestion
:packets queue,wait for link use - 存储转发
store and forward
:节点在转发之前接收完整分组- 转发(数据报网路、虚电路网络)
-
Question:
假设有以下线路:
需要转发的报文总大小为
L=7.5Mb
,划分为每个大小为l=1.5Kb
的分组,每段线路传输速率为R=1.5Mbps
,则计算传输的总延迟为多少?解:当最后一个包到达
Router1
时,还有一个包在Router2
,所以总延迟为:
D e l a y a l l = L R + 2 l R = 5 + 0.002 = 5.002 s Delay_{all}=\frac{L}{R}+\frac{2l}{R}=5+0.002=5.002s Delayall=RL+R2l=5+0.002=5.002s
分组交换:统计复用
-
-
分组交换VS电路交换
- 分组交换允许更多的用户来使用网络
- 1 Mb/s link
- each user: 100kb/b when “active”; active 10% of time
- circuit-switching: 10 users
- packet switching: with 35 users, probability > 10 active less than 0.0004
- 分组交换并不是稳赢不输“slam dunk winner”的
- Creat for bursty data(资源共享;简单,无建立阶段)
- 过度拥塞:分组延迟与丢失
- 协议需要可靠的数据传输与拥塞控制
-
1.3.3、接入网络与物理媒体
Q:如何将网络边缘接入核心网(边缘路由器)
- 住宅(家庭)接入网络
residential access nets
- 机构接入网络
institutional access networks
- 移动接入网络
mobile access networks
需要关心的是:
- 带宽
bandwidth(bps)
- 共享or独占
- 哪里接入
- 哪个ISP
Internet Server Producer
接入网络
-
住宅(家庭)接入:点对点接入
-
拨号上网
Dialup via modem
:不能同时上网与接打电话 -
非对称数字用户电路
asymmetric digital subscriber line,ADSL
:- 上行传输速率<1Mbps
- 下行传输速率<8Mbps
- FDM:
- 0kHz-4kHz:传统电话
- 4kHz-50kHz:上行
- 50kHZ-1MHz:下行
-
电缆网络
- 混合光纤同轴电缆
Hybrid fiber coax,HFC
- 非对称:下行高达30Mbps,上行高达2Mbps
- 各家庭(设备)通过电缆网络/光纤接入ISP路由器
- 各家庭共享电缆头端的接入网络
- 不同于
DSL
的独占至中心局的接入
- 混合光纤同轴电缆
-
-
机构(公司接入):
LAN
-
通过局域网连接终端与边缘路由器;
-
以太网:共享或专用链路连接终端与路由器;
-
-
无线接入网络
Wireless access networks
-
通过共享的无线接入网络连接端系统与路由器
- 通过基站
base station
或接入点access point
- 通过基站
-
无线局域网
LANs
:802.11b/g(WiFi)——11Mbps、54Mbps传输速率 -
广域无线接入
- 通过电信运营商
- WAP/GPRS(通用分组无线接入) in Europe
- 3G、4G:LTE
-
物理媒体
物理线路
Physical link
:what lies between transmitter & receiver \传输Bit
引导性媒体:电缆、光纤
非引导性媒体:无线电
1.双绞线Twisted Pair,TP
-
3类双绞线:传统电话线
-
5类双绞线:100Mbps Ethernet(交叉点密度大)
-
目前,在局域网中常用到的双绞线是非屏蔽双绞线
UTP
,分为:3、4、5、超5、6、7类: -
T568A与T568B
- 二者没有本质的区别,只是颜色上的区别 ,只要保证:
- 1,2 线对是一个绕对;3,6线对是一个绕对
- 4,5 线对是一个绕对;7,8线对是一个绕对
- 注意:不要在电缆一端用T568A,另一端用T568B,T568A/T568B的混用是跨接线的特殊接线方法。
- 二者没有本质的区别,只是颜色上的区别 ,只要保证:
2.同轴电缆
- 同轴电缆的结构:
- 中央:铜质的芯线(单股的实心线或多股绞合线);
- 铜质的芯线外包着一层绝缘层;
- 绝缘层外是一层网状编织的金属丝作外导体屏蔽层(可以是单股的),屏蔽层把电线很好地包起来;
- 再往外就是外包皮的保护塑料外层。
- 目前经常用于局域网的同轴电缆有二种:
- 一种是专门用在符合IEEE802.3标准以太网环境中阻抗为50Ω的电缆,只用于数字信号发送,称为基带同轴电缆;
- 另一种是用于频分多路复用FDM的模拟信号发送,阻抗为75Ω的电缆,称为宽带同轴电缆;
3.光纤
-
玻璃光纤传输光脉冲、一个脉冲一个Bit
-
高速操作(点对点)
-
低错误率:中继器
Repeaters
可以隔的比较远 -
免疫电磁干扰
-
光纤的工作原理:光线在光纤中不断的进行全反射
4.无线电
- 传播过程的环境影响:reflection、Obstruction、Interference
- 链路类型
- 地面微波
- 局域网(eg. WiFi)
- wide-area(eg. cellular)
- satellite:延迟270ms
1.4 Delay, Loss, and Throughput in packet-switched networks
1.4.1 Overview of Delay in Packet-Swithed Networks(分组交换网络的延迟概述)
Recall that a packet starts in a host (the source), passes through a series of routers, and ends its journey in another host (the destination). As a packet travels from one node (host or router) to the subsequent (随后的) node (host or router) along this path, the packet suffers from several types of delays at each node along the path.The most important of these delays are the nodal processing delay (节点传播时延), queuing delay, transmission delay, and propagation delay; together, these delays accumulate to give a total nodal delay.
Types of Delay
As part of its end-to-end route between source and destination, a packet is sent from the upstream node through router A to router B. Our goal is to characterize the nodal delay at router A. Note that router A has an outbound link leading to router B. This link is preceded by a queue (also known as a buffer). When the packet arrives at router A from the upstream node, router A examines the packet’s header to determine the appropriate outbound link for the packet and then directs the packet to this link. A packet can be transmitted on a link only if there is no other packet currently being transmitted on the link and if there are no other packets preceding it in the queue; if the link is currently busy or if there are other packets already queued for the link, the newly arriving packet will then join the queue.
-
Nodel Processing Delay
- Examine the packet’s header
- Determine where to direct the packet
- Check for bit-level errors in the packet that occurred in transmitting the packet’s bits from the upstream node to router A.
- High-speed routers: on the order of (大约) microseconds or less
-
Queuing Delay
- The time that waits to be transmitted onto the link
- Depends on congestion level of router
- Vary from packet to packet
-
Transmission delay (传输时延)
- Time required to push all of the packet’s bits into the link
- L: Packet length (bits) R: Link bandwidth (bps) Time to send all bits into link = L/R
- Typically on the order of microseconds to milliseconds in practice.
-
Propagation Delay (传播时延)
- Time required to propagate from the beginning to the end.
- The bit propagates at the propagation speed of the link. The propagation speed depends on the physical medium of the link (that is, fiber optics, twisted-pair copper wire, and so on) and is in the range of 2x 1 0 8 10^8 108 meters/sec to 3x 1 0 8 10^8 108meters/sec
- d: Length of physical link s = proppagation speed propagation delay = d/s
- R and s are very different quantities
- 时延带宽积:(d/s)*R
- Once the last bit of the packet propagates to node B, it and all the preceding bits of the packet are stored in router B.
- In wide-area networks, propagation delays are on the order of milliseconds.
-
The difference between transmission delay and propagation delay
- The transmission delay is the amount of time required for the router to push out the packet; it is a function of the packet’s length and the transmission rate of the link, but has nothing to do with the distance between the two routers.
- The propagation delay, is the time it takes a bit to propagate from one router to the next; it is a function of the distance between the two routers, but has nothing to do with the packet’s length or the transmission rate of the link.
-
Nodel Delay:
- d n o d e l = d p r o c + d q u e u e + d t r a n s + d p r o p d_{nodel}=d_{proc}+d_{queue}+d_{trans}+d_{prop} dnodel=dproc+dqueue+dtrans+dprop.
-
Question:
两个主机
A
、B
相距L=10000km
,由一条带宽R=1Mbps
的链路连接,该链路传播速度v=2.5x10e8mps
,那么:- 传播时延
Tp
是多少? - 在这段时间内,主机
A
向链路发送了多少个bit
? - 每个
bit
间距d
是多少?
解:
ATTENTION:带宽取决于链路物理特性,不更换链路就不会改变;
ATTENTION:参数 L R V \frac{LR}{V} VLR称为时延带宽积,描述了链路能够容纳的数据量,可以反映链路的利用率
T p = L V = 0.04 s n u m = T p × R = 41943 d = L n u m = 238 m Tp=\frac{L}{V}=0.04s\\ num = Tp\times R=41943\\ d=\frac{L}{num}=238m Tp=VL=0.04snum=Tp×R=41943d=numL=238m - 传播时延
1.4.2 Queuing Delay and Packet Loss
- Queueing Delay
- R = Link bandwidth (bps)
- L=Packet Length (bits)
- a= The average rate at which packets arrive at the queue
- Traffic Intensity (流量强度) = La/R
-
La/R > 1 means the average rate at which bits arrive at the queue exceeds the rate at which the bits can be transmitted from the queue. The queue will tend to increase without bound and the queuing delay will approach infinity.
-
La/R --> 0 average queuing delay small
-
La/R --> 1 delays become large
- Packet Loss
- Buffer’s finite capacity
- When packet arrives to full queue, packet is dropped
- Lost packet may be retransmitted by previous node, by source end system, or not retransmitted at all
1.4.3 End-to-End Delay
- Traceroute program: provides delay mesurement from source to router along end-end Internet path toeards destiantion
- 原理:
- 发送三个分组到链路上的每个路由器;
- 每个路由器在接收到分组后会回发分组
return packets
; - 发送端通过时间间隔计算时延;
- 原理:
(关注粗体即可)
1.5 Prototol Layers and Their Service Models (协议层次与服务模型)
From our discussion thus far, it is apparent that the Internet is an extremely complicated system. We have seen that there are many pieces to the Internet: numerous applications and protocols, various types of end systems, packet switches, and various types of link-level media.
1.5.1 Layered Architecture
-
Horizontal layering of airline functionality
- Note:
- Each layer, combined with the layers below it, implements some functionality, some Service.
- Each layer provides its service by:
- performing certain actions within that layer
- using the services of the layer directly below it
- Note:
-
Protocal Layering
To provide structure to the design of network protocols, network designers organize protocols—and the network hardware and software that implement the protocols—in layers, each protocol belongs to one of the layers.
We are again interested in the services that a layer offers to the layer above—the so-called service model of a layer. Just as in the case of our airline example, each layer provides its service by (1) performing certain actions within that layer and by (2) using the services of the layer directly below it.
For example, the services provided by layer n+1 may include reliable delivery of messages from one edge of the network to the other. This might be implemented by using an unreliable edge-to-edge message delivery service of layer n, and adding layer n functionality to detect and retransmit lost messages.
原语:请求原语(发送端请求服务)、指示原语、响应原语、确认原语 -
Advantages:
- Provides a structured way to discuss system components;
- Modularity makes maintenance and updates of system components easier;
- The remainder of the system remains unchanged when a layer’s implementation is changed;
- 促进标准化工作;
- Provides a structured way to discuss system components;
-
Drawbacks:
-
one layer may duplicate lower-layer functionality;(errors checking)
-
functionality at one layer may need information, that is present only in another layer;(violates the goal of separation of layers)
-
典型的协议分层
-
ISO:OSI/RM (Open System Interconnective Reference Model, 开放系统互联参考模型)——理论上的模型
Seven-layer ISO OSI Reference Model Layers’ Name (Chinese) Application 应用层 Presentation 表示层 Session 会话层 Transport 传输层 Network 网络层 Link 传输链路层 Physical 物理层 - 为什么没有得到广泛的应用?
- 时机问题:TCP/IP早于OSI出现,并得到认可;
- 技术问题;
- 实现问题;
- 为什么没有得到广泛的应用?
-
TCP/IP——工业驱动、The Heart of Internet
Five-layer ISO OSI Reference Model Layers‘ Name (Chinese) Application 应用层 Transport 传输层 Network 网络层 Link 传输链路层 Physical 物理层 - Application Layer:
- Supporrting network applications
- Transport Layer:
- Host-host data transfer
- Network Layer:
- moving network-layer packets known as datagrams(数据报) from one host to another.
- Link Layer:
- Data transfer between neighboring network elements.
- Physical Layer:
- Move the individual bits within the frame from one node to the next.
- Application Layer:
-
-
Protocal stack: The protocols of the various layers
-
Layer Protocal stack Application FTP, SMTP, HTTP, POP3 Transport TCP, UTP Network IP, routing protocols, ICMP, IGMP, RIP Link PPP, Etherner Physical(bits “on the wire”) /
-
-
PDUs in TCP/IP (协议数据单元)
- Application Layer: Message(报文)
- Transport Layer: Segment(报文段)
- Network Layer: Packet(数据报) or Datagrams
- Data Link Layer: Frame(帧)
- Physical Layer: bits “on the wire”
-
TCP/IP protocol Suite(协议族)
- Suite: big family with many members
- Suite: big family with many members
-
实体、协议、服务和服务访问点
- 实体:任何可发送和接收信息的硬件或软件过程
- 协议:控制两个对等实体进行通信的规则的集合
- 在协议的控制下,两个对等实体间的通信使得本层能够向上一层提供服务;
- 本层协议的实现,需要使用下层所提供的服务;
- 下层的协议对上层的服务用户是透明的(或者说,本层的服务用户只能看见下层的服务而无法看见下层的协议);
- 协议是“水平的”,即协议是控制对等实体之间通信的规则;
- 服务是“垂直的”,即服务是由下层向上层通过层间接口提供的;
- 必须把所有不利条件估计到,而不能假定一切正常;
- 计算机网络协议是否正确,必须检查协议是否能应付各种异常情况;
- 同一服务相邻两层的实体进行交互的地方,称为服务访问点(Service Access Point, SAP)。
-
1.5.2 Encapsulation(封装)
- Figure below shows the physical path that data takes down a sending end system’s protocol stack, up and down the protocol stacks of an intervening link-layer switch and router, and then up the protocol stack at the receiving end system.
-
Routers and link-layer switches organize their networking hardware and software into layers, but routers and link-layer switches do not implement all of the layers in the protocol stack; they typically implement only the bottom layers.
- Routers recognize IP addresses, while link-layer switches not, it can recognize Ethernet addresses.
-
Note that hosts implement all five layers; this is consistent with the view that the Internet architecture puts much of its complexity at the edges of the network
-
At the sending host, an application-layer message (M in Figure) is passed to the transport layer. In the simplest case, the transport layer takes the message and appends additional information (so-called transport-layer header information, H t H_t Ht in Figure) that will be used by the receiver-side transport layer. The application-layer message and the transport-layer header information together constitute the transport-layer segment. The transport-layer segment thus encapsulates the application-layer message. The added information might include information allowing the receiver-side transport layer to deliver the message up to the appropriate application, and error-detection bits that allow the receiver to determine whether bits in the message have been changed in route. The transport layer then passes the segment to the network layer, which adds network-layer header information ( H n H_n Hn in Figure) such as source and destination end system addresses, creating a network-layer datagram. The datagram is then passed to the link layer, which (of course!) will add its own link-layer header information and create a link-layer frame. Thus, we see that at each layer, a packet has two types of fields: header fields and a payload field. The payload is typically a packet from the layer above.