当前位置:网站首页>互联网协议
互联网协议
2022-07-07 09:07:00 【全栈程序员站长】
## 互联网协议 – 概括:从上到下,越上越接近用户,越下越接近硬件 – 应用层: + 规定应用程序的数据格式 + [HEAD(以太网标头) [HEAD(IP标头) [HEAD(TCP标头) DATA(应用层数据包)]]]
– 传输层(端口到端口的通信): 定义端口号 + 端口: * 0到65535(2^16)的整数 * 进程使用网卡的编号 * 通过IP+mac确定主机,只要确定主机+端口(套接字socket),就能进行程序间的通信 + UDP协议: * 数据包中加入端口依赖的新协议 * 数据包[HEAD(发送、接收mac) [HEAD(发送、接收ip) [HEAD(发送、接收端口) DATA]]] * 简单,可靠性差,不知道对方是否接受包 + TCP协议: * 带有确认机制的UDP协议 * 过程复杂,实现困难,消耗资源 “` tcp/ip connect: tcp/ip的三次握手 标有syn的数据包 ————-> 标有syn/ack的数据包 client <————- server 标有ack的数据包 ————–> “`
– 网络层(主机到主机的通信):定义IP “` tcp/ip finish: tcp/ip的四次握手 fin <————- ack client ————-> server fin ————-> ack <————- “`
– 网络层(主机到主机的通信): + IP协议 * ipv4: – 32个二进制位表示,由网络部分和主机部分构成, – 子网掩码: 网络部分都为1,主机部分都为0,目的判断ip的网络部分,如255.255.255.0(11111111.11111111.11111111.00000000) – IP数据包:标头Head+数据Data,放进以太网数据包的Data部分[HEAD [HEAD DATA]] – IP数据包的传递: + 非同一网络:无法获得mac地址,发送数据到网关,网关处理 – ARP(Address Resolation Protocol): 解析地址协议,通过ip解析mac地址 + 同一网络:mac地址填写FF:FF:FF:FF:FF:FF:FF,广播数据,对比ip,不符合丢包
– 链接层:定义mac + 定义数据包(帧Frame) * 标头(Head):数据包的一些说明项, 如发送者、接收者、数据类型 * 数据(Data):数据包的具体内容 * 数据包:[HEAD DATA] + 定义网卡和网卡唯一的mac地址 * 以太网规定接入网络的所有终端都应该具有网卡接口,数据包必须是从一个网卡的mac地址到另一网卡接口的mac地址 * mac全球唯一,16位16位进制组成,前6厂商编号,后6网卡流水号 + 广播发送数据 * 向本网络内的所有设备发送数据包,对比接收者mac地址,不是丢包,是接受
– 实体层:物理层 + 终端(pc,phone,pad…)的物理连接(光缆,电缆,路由…),负责传递0和1信号
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113825.html原文链接:https://javaforall.cn
边栏推荐
- 【亲测可行】error while loading shared libraries的解决方案
- BUUCTF---Reverse---reverse1
- Mendeley -- a free document management tool that automatically inserts references into papers
- Hash / (understanding, implementation and application)
- uniCloud
- July 10, 2022 "five heart public welfare" activity notice + registration entry (two-dimensional code)
- 变量的解构赋值
- Static semantic check of clang tidy in cicd
- 基于STC8G1K08的0.96寸IIC液晶屏驱动程序
- Network foundation (1)
猜你喜欢

Mendeley -- a free document management tool that automatically inserts references into papers

I plan to take part in security work. How about information security engineers and how to prepare for the soft exam?

数据库同步工具 DBSync 新增对MongoDB、ES的支持

基于DE2 115开发板驱动HC_SR04超声波测距模块【附源码】

Antd select selector drop-down box follows the scroll bar to scroll through the solution

单调性约束与反单调性约束的区别 monotonicity and anti-monotonicity constraint

Use load_ decathlon_ Datalist (Monai) fast loading JSON data

JS add spaces to the string
![[STM32] actual combat 3.1 - drive 42 stepper motors with STM32 and tb6600 drivers (I)](/img/cd/7cd8e2e77419c65d633a2a235b2362.png)
[STM32] actual combat 3.1 - drive 42 stepper motors with STM32 and tb6600 drivers (I)

The gun startles the dragon, and the crowd "locks" Zhou Zhi
随机推荐
[actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
SQL Server knowledge collection 11: Constraints
[untitled]
VR development optimization
Kitex 重试机制
[installation system] U disk installation system tutorial, using UltraISO to make U disk startup disk
Vuthink正确安装过程
Activity生命周期
Mendeley -- a free document management tool that automatically inserts references into papers
基于Retrofit框架的金山API翻译功能案例
【C#】WinForm运行缩放(变糊)的解决方法
Kitex retry mechanism
2021-04-08
uniapp 在onLaunch中跳转页面后,点击事件失效解决方法
[C #] the solution of WinForm operation zoom (blur)
Mpx 插件
V-for img SRC rendering fails
Add a self incrementing sequence number to the antd table component
CentOS系统下Redis安装和自启动配置的步骤
Go redis Middleware