TCP/IP协议族 总结

几点注意:

1. 这篇文章是我复习KTH课程Internetworking时的学习笔记。主要的参考资料为课本与课件。

    课本:Behrouz A. Forouzan, TCP/IP Protocol Suite, 3nd Edition, 2005, McGraw-Hill, ISBN 0-07-296772-2

2. 全文篇幅比较长,建议利用目录查找需要的内容

3. 由于课程是英文授课,所以许多地方中英混合出现,写的比较粗糙

4. 有可能会出现图片打不开的情况,翻墙会解决这个问题

5. 我在github上上传了pdf版,有需要可以下载

目录

Lecture 2 Link Layer

1. Basic introduction

2. Collision in Ethernet:

3. Ethernet (有线) address & MAC address

4. Collision in Wireless LAN (Problem 1. Hidden station problem)

5. 数据链路层还分MAC和LLC子层

Review of Lecture 2

Lecture 3 Network layer fundamentals - Basic forwarding IP addressing

1.In general

2. Forwarding

4. Allocate address

Lecture 4 IP

1. IPv4&IPv6 packet

2. IPv4&IPv6 Fragmentation

3. IPv4 header vs IPv6 header

Lecture 5 IP, ARP, more IP and ICMP  

1. ARP

2. IP options (extension header)

3. ICMP

Lecture 6&7 Routing

1.In general

2. Bellman-Ford Algorithm

3. Real network中的问题和解决

4. Dijkstra's shortest path algorithm

6. Routing Protocols

Lecture 8&9 Transport Layer-UDP, TCP and beyond

1.In general

2. UDP

3. TCP

Lecture 10 &11 Application Layer

1.In general

2.Creating network applications  

3.Web and HTTP  

4. Remote login--Telnet & SSH

5. Email

Lecture 12 DNS

Summary

Lecture 13 IP Configuration 分IP地址

1. BOOTP—Bootstrap Protocol  

2. DHCP—Dynamic Host Configuration  

3. Host Configuration—SLAAC--Stateless Autoconfiguration

4. IPv6 Autoconfiguration—Plug and Play

5. Stateful and Stateless Autoconfiguration

Lecture 14 IP Security

1. Overview

2. Encapsulation Formats

3. IPsec and IPv6

4. IKE

Lecture 15 IP Gateways

1. Firewall

2. NAT-Network Address Translation

总图


Lecture 2 Link Layer

1. Basic introduction

Data Link Layer has responsibility transferring datagram between adjacent nodes over a link. (Data link layer packet is a frame, encapsulates datagram into frame.)

Link addressing: MAC address

 

2. Collision in Ethernet:

Capture.PNG

CSMA: Listen before sending. Half-duplex link. But it cannot avoid all collision because there is propagation delay of each frame.

CSMA/CD: Listen while sending. If collision is detected, abort transmission and retry.

Capture.PNG

No collision (nowadays used):

Bridge learns location of MAC addresses by inspecting (检查) source address field in incoming frames.

 

3. Ethernet (有线) address & MAC address

The both are 48-bit number used to uniquely identify each computer in a network. The address is usually written in hexadecimal form.

The Ehernet address is the most common form of MAC address.

Capture.PNG

 

4. Collision in Wireless LAN (Problem 1. Hidden station problem)

Capture.PNG

To avoid collision (Now we cannot use CDMA/CD), we use CDMA/CA:

Capture.PNGCapture.PNG

Problem 2 (RTS and CTS cannot solve this problem this time.)

Capture.PNG

C have to wait to send data to D until A finish sending data to B.

 

5. 数据链路层还分MAC和LLC子层

Capture.PNG

MAC连接LLC子层和下级物理层。从LLC子层接受数据,附加上MAC地址和控制信息后再校验一下放到物理层去。

其中最重要的概念是MAC address。

 

Review of Lecture 2

Capture.PNG
 


Lecture 3 Network layer fundamentals - Basic forwarding IP addressing

1.In general

End-to-end delivery of packets independent of the underlying link layer technologies.

Connectionless (只规定destination, 不规定具体路线): Packets may arrive in different paths, and may not receive in order.

IP: Implemented using unicast addresses shared between several hosts.

Direct Dilivery

Indirect Dilivery

Capture.PNG

Host to host or router to host

Capture.PNG

Host to router or router to router

– Destination and sender connected to the same physical network

• Last delivery is direct

– Destination address and local interface have same network address (use netmask)

– From host to router or from router to router

– Destination address and forwarding table:

forwarding

2. Forwarding

The last one is using nowadays.

No.1

Capture.PNG

No.2

Capture2.PNG

No.3


3. IPv4 Addressing

(IPv6 address is 128 bit long.)

 

Capture2.PNG

Capture3.PNG

– Address & Mask = NetID (network address)

– Address & !Mask = HostID (host address)

– Address | !Mask = Directed broadcast address

(limited broadcast address是都set to 1,255.255.255.255)

 

4. Allocate address

Capture.PNG

Address range 是从 network address 到 broadcast address 的.

Capture.PNG

 

File_001.png

Reading instruction:

Ch 5,12.2,26



Lecture 4 IP

1. IPv4&IPv6 packet

Capture.PNG

Packet contains source and destination addresses.

IPv6 没有 header length field (因为长度(不包括extension header)是固定的).

 

2. IPv4&IPv6 Fragmentation

MTU是数据链路层的限制,但是fragmentation发生在网络层

注意UDPheader只有8 bytes长

Capture2.PNG

Capture2.PNG

Flags:

– RF (Reserved Fragment) – for future use (set to 0)

– DF (Dont Fragment).

• Set to 1 if datagram should not be fragmented.

• If set and fragmentation needed, datagram will be discarded and an error message will be returned to the sender

– MF (More Fragments)

• Set to 1 for all fragments, except the last.

Capture.PNG

IPv6只能在source,不能再中间的router上面做fragmentation

 

3. IPv4 header vs IPv6 header

 

IPv4

IPv6

header length

20-60 bytes

40 bytes

header length field

没有 (header length fixed)

name of down-counter

lifetime of every datagram

(可以自行设置, Default initial value: 64)

TTL (8 bit)

每经过router, -1. =0时丢弃

Every router holding a datagram for more than 1 second should decrement the TTL by the number of seconds

Hop Limit (8 bit)

 

connectionless

connection-oriented

Because of the adding of flow label (textbook P830)

 

Capture.PNG

IP Network layer functions  

IPv4实现方法

IPv6实现方法

Logical addressing

Locating hosts

Routing

Path determination

Forwarding

Move Packet from input to output of the routers

Fragmentation

Adaption to lower layer

Multiplexing/demultiplexing

(多路复用和解复用)

Many transport layer protocols

Error detection + avoidance

checksum

-

QoS (Quality of Service)

ToS (Type of Service): 8 bit

^{\[1]}Traffic Class: 8 bit

Flow Label: 20 bit

[1] The flow label field allows labeling packets belonging to a particular flow for which the sender requests the same handling. A flow is identified by the source address, destination address, and a nonzero flow label, and packets belonging to a flow should be treated the same way by a router (rfc6437)

The first 6 bits of the traffic class field hold the DiffServ Code Points (DSCP), which can be used for classifying packets in order to implement priorities. The last 2 bits are used for ECN, and serve for signaling congestion in the network. (rfc3260)

Reading instruction:

Ch 6,7,27


Lecture 5 IP, ARP, more IP and ICMP  

1. ARP^{\[2]}

已知IP address,想得到MAC address:ARP (Address Resolution Protocol)  

已知Name(域名,比如kth.se),想得到IP address: DNS

捕获.PNG

注意这个过程在高速缓存cache中存储了,所以第二次传输datagram的时候不需要再进行APR request (broadcast) 和APR reply (unicast)。

[2] Address Resolution的方式包括:

(用于IPv4的Address Resolution Protocol – ARP,这一部分中介绍)

(用于IPv6的Neighbor Discovery Protocol – ICMPv6,单独在3. ICMP中介绍)

代理ARP:

捕获.PNG

捕获.PNG

 

2. IP options (extension header)

 

IPv4

IPv6

Purpose

Control, testing and debugging of the network functionality

Length

IPv4: Max 40 bytes^{\[3]}

(Max header length is 60 bytes in IPv4)

IPv6: No limitations^{\[4]}

Option Format

Capture.PNG

Capture.PNG

Option Type

End of option

Hop-by-hop options (Pad1&PadN&jumbao payload)

用于当source需要把信息传递给datagram经过的所有routers时. eg,.if the length of the datagram is more than the usual 65535 bytes.

Capture.PNG

Capture2.PNG

Capture3.PNG

No operation

Routing

Loose source route^{\[5]}

Fragment

Timestamp

Authentication Header

Record route

Encapsulating Security Payload

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值