overview
Contents
如何理解OSI或TCP/IP协议的层次划分和结构 ? - 向往美的回答 - 知乎
Bandwidth Vs. Latency: Which Is More Important?
overview
what: 分层协议,解决如何在互联网传输数据
history:
- IETF(前身国防部) 指定ip层以上相关协议
- key rfc: rfc 1122, define layer; rfc 2616, define http1.1
- IEEE管指定 物理层和链路层的协议
layer detail
osi vs tcp/ip:
- tcp/ip: 实际使用的模型,更简化
- osi: 概念模型,未被实现
tcp/ip layers:
- linker layer
- internet layer
- transport layer:
- application layer
链路层(linker layer): 局域网内如何传输 protocol list: mac
internet layer: 网路层如何路由 protocol list: ip
transport layer: 点对点传输 protocol list:tcp,udp
application layer: 应用相关数据 protocol: ethernet
What happens when you type a URL in the browser
how:
- DNS resolve: GET IP
- shake: tcp and ssl shake
- client: send data with http format
- sever: send response with http format
- browser: parse data and display
how transport by ip:
- blow transport
- arp protocol get ip->mac address
- liner: send by mac address
command
-
ifconfig lo: virtual network interface that your computer use to communicate with itself;
-
tcpdump inspect netwrok
1 2 3 4
tcpdump -# -S -n -i lo0 tcp and host 127.0.0.1 and port 8000 tcpdump -nl eth0 tcpdump -eni any ip
- -#: print a optinal package number
- -S: print the absolute sequence number
- -n: don’t convert address to names
- -i:interface
- -e: Print the link-level header on each dump line
-
- expression: xxx and xxx
-
nc: create or connect tcp/udp connection
- nc -l: create a listener
- nc localhost 8000: connect the address
Test
-
lantency vs bandwith
- lantency: a packet round-trip time,两点之间距离,ms,
主要是客观距离因素造成,交钱也无法提高
- bandwidth: mbps, total data in a second, 类似单位时间人流量,管道的横街面积; mbps;
运营商限制了,可以交钱提高
- lantency: a packet round-trip time,两点之间距离,ms,
-
affect:
- lantency important in: live, game, videochat, 需要实时响应
- bandwidth in : movies; 持续大量传输数据
-
in browsering
- low bandwidth and low lantency: 初始立即有内容,但页面加载慢
- high lantency and high bandwidth: 初始白屏时间长,后续流畅;
basic information
1. router
forward data between different networks
2. gateway
a router provide access for packets of local network
gatway must be a router;
mtu
MTU: max transfer unit MSS: max segment size: 1460
mss announcementL: