CCNP必备: Linux网络及0SI7层模型深入讲解

简介: CCNP必备: Linux网络及0SI7层模型深入讲解

CCNP必备: Linux网络及0SI7层模型深入讲解

 

 

Internet

 

1、Intemet Protoce (IP)

 

假设有一个应用程序在这台电脑上,它想访问这台电脑上的另一个应用程序,然后到运用层再到传输层。
image.png

 

IP地址,目标IP地址。数据电路层

image.png

ARP来找到MAC

image.png

ARP广播找到3.2

image.png

到达目标

image.png

处理ARP请求

image.png

 image.png

 

会填入表格

image.png

 

 

回应(单播)

image.png

 image.png

 

 

在自己的ARP表里把对方电脑的IP地址和MAC地址的对应关系填到一个表里

image.png

 

填入SYN

image.png

 

处理每一层的信息

image.png

 

响应之后

image.png

三次握手结束

image.png

考虑发数据

image.png

最终数据

image.png


2
Intemet Control Message Protocol (ICMP )

用来实现pin命令

可以用来判断网络状态(根据不同的网络状态会返回不同的信息)

ICMP数据包大小默认64字节

PING image.png172.20.0.1 (image.png172.20.0.1) 56(84) bytes of data.
64 bytes from                                    image.png172.20.0.1: icmp seq=1 tt1=64 time=3.20 ms 64 bytes from image.png172.20.0.1: icmp seq=2 tt1=64 time=0.547 ms

64 bytes from image.png172.20.0.1: icmp seq=3 tt1=64 time0.390 ms

image.png172.20.0.1 ping stati stics
3 packets tr ansmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 0.390/1.381/3.208/1.293 ms
[root@centos7 ~]#ping image.png172.20.0.12
PING image.png172.20.0.12 (image.png172.20.0.12) 56(84) bytes of data .
From image.png172.20.102.77 icmp seq=1 Destination HostUnreachable
From image.png172.20.102.77 icmp seq=2  Destination Host Unreachab le
From 172. 20.102.77 icmp seq=3   Destination Host Unreachab 1e
From 172. 20.102.77 icmp seq=4   Destination Host Unreachab le
From 172. 20.102.77 icmp seq=5   Destination Host Unreachab le
From 172. 20.102.77 icmp seq=6   Destination Host Unreachab le
From 172. 20.102.77  icmp seq=7  Destination Host Unreachab le
From image.png172.20.102.77 icmp_ seq=8 Destination Host Unreachabl
image.png172.20.0.12 ping statistics
9 packets transmitted, 0 received, +8 errors, 100% packet loss, ti me 8003ms pipe 4

[root@centos7 ~]#ping image.png172.20.0.12 -s 65508
Error: packet size 65508 is too large. Maximum is 65507

[root@centos7 ~] #pir image.png172.20.0.12 -s 65507
PING image.png172.20.0.12 (image.png172.20.0.12) 65507(65535) bytes of data.
image.png172.20.0.12 ping statistics
4 packets transmitted, 0 received, 100% packet loss, ti me 3000ms
[root@centos7 ~]#ping image.png192.168.30.128 -S 65507
PING image.png192.168.30.128 (image.png192.168.30.128) 65507(65535) bytes of data.

65515 bytes from image.png192.168.30.128: icmp seq=1 tt1=64 time=4.48 ms

65515 bytes from 192.168. 30.128: icmp_ seq=2 tt1=64 time=1.19 ms

65515 bytes from 192.168. 30.128: icmp_ seq=3 tt1=64 time=1.08 ms
image.png192.168.30.128 ping statistics ---
3 packets transmitted, 3 received , 0% packet loss, time 2004ms rtt min/avg/max/mdev = 1. 083/2.25214.482/1.577 ms
[root@centos7 ~]#ping 192.168. 30.128
PING 192.168. 30.128 (192.168. 30.128) 56(84) bytes of data .64 bytes from 192.168. 30.128: icmp_ seq=1 tt]=64 time=2.81 ms
64 bytes from 192.168. 30.128: icmp seq=2 tt]=64 time=0.585
ms
64 bytes from 192.168. 30.128: icmp_ seq=3 tt 1=64 ti me=0.217ms
64 bytes from 192.168. 30.128: icmp_ seq=4 tt1=64 time=0. 335ms
64 bytesfrom 192.168. 30.128: icmp_ seq=5 tt1=64 time=0.340 s
64 bytesfrom 192.168. 30.128: icmp_ seq=6 tt1=64 time=0. 302ms
64 bytes from 192.168. 30.128: icmp_ seq=7 tt1=64 time0.260 ms

64 bytes from image.png192.168.30.128: icmp_ seq=8 tt1=64 time0.260 ms
image.png192.168.30.128 ping statistics ---

8 packets tr ansmitted, 8received 0% packet loss, time 7007 ms  rtt mi n/avg/max/mdev = 0.217 /0.639/2.814/0.828 ms
[root@centos7 ~]#ping image.png192.168.30.128 -s 65507
PING image.png192.168.30.128 (image.png192.168.30.128) 65507(65535) bytes of data .

65515 bytes from image.png192.168.30.128: icmp seq=1 tt]=64 time=1.68 ms

65515 bytes from 192.168. 30.128: icmp_ seq=2 tt1=64 time1.39 ms

65515bytes from image.png192.168.30.128: icmp_ seq=3 tt1=64 ti me=1.50 ms

65515 bytes from image.png192.168.30.128: icmp_ seq=4 tt1=64 time=1.44 ms

65515 bytes from image.png197.168.30.128: icmp_ seq=5 tt 1=64 time=1.48 ms

65515  bytes from image.png192.168.30.128: icmp seq=6 tt]=64 time=1.46 ms

65515 bytes from 192.168. 30.128: icmp_ seq=7 tt1=64 time=1.39 ms

65515bytes from 192.168. 30.128: icmp_ seq=8 tt]=64 time=1. 47 ms  

65515 bytes from 192.168. 30.128: icmp_ seq=9 tt1=64 time=1. 88 ms  

65515 bytes from 192.168. 30.128: icmp_ seq=10 tt]=64 time=1. 38ms

65515 bytes from 192.168. 30.128: icmp_ seq=11 tt1=64 time=1. 34ms
nC
image.png192.168.30.128 ping statistics
11 packets transmitted, 11 received 0% packet loss, time 10019ms rtt min/avg/max/mdev = 1. 346/1 496/1. 882/0.154ms

 

3Address Resolut on Protocol (ARP)

地址解析协议

IP地址映射成Ethernet地址
image.png

如何寻找IP地址

image.png

[ root@centos7 ~]#arp -n

Address               HWtype      HWaddress           Flags MaskC  

image.png192.168.30.1       ether       00:50:56:c0:00:01   C
image.png192.168.30.254     ether      00:50:56:f6:f5:40   C
image.png172.20.0.1         ether       08:57:00:f0:aa:d7   C
172. 20.109.98      ether        00:0c:29:13:bb:9e   C
image.png192.168.30.128     ether      0:0c:29:e1:f7:aa    C
image.png172.20.0.12        ether       (incomplete)      
Flags MaskC
C
Iface ens33 ;ens33ens37ens37ens33ens37

 

演示

image.png


4
Reverse Address Resolution Protocol (RARP)

无盘工作站(电脑上由CPU内存没有硬盘),没办法装系统,需要向网络中发送请求(请给我一个IP 地址),由MAC转换为IP。得到的地址是固定的。

相关文章
|
1天前
|
网络协议 Linux 网络架构
|
4天前
|
域名解析 网络协议 Linux
linux网络配置详解
linux网络配置详解
13 0
|
5天前
|
网络协议 Java Linux
【探索Linux】P.29(网络编程套接字 —— 简单的TCP网络程序模拟实现)
【探索Linux】P.29(网络编程套接字 —— 简单的TCP网络程序模拟实现)
11 0
|
5天前
|
存储 网络协议 算法
【探索Linux】P.28(网络编程套接字 —— 简单的UDP网络程序模拟实现)
【探索Linux】P.28(网络编程套接字 —— 简单的UDP网络程序模拟实现)
11 0
|
5天前
|
网络协议 算法 Linux
【探索Linux】P.27(网络编程套接字 —— UDP协议介绍 | TCP协议介绍 | UDP 和 TCP 的异同)
【探索Linux】P.27(网络编程套接字 —— UDP协议介绍 | TCP协议介绍 | UDP 和 TCP 的异同)
14 0
|
1天前
|
安全 网络协议 Linux
linux必学的60个命令
Linux是一个功能强大的操作系统,提供了许多常用的命令行工具,用于管理文件、目录、进程、网络和系统配置等。以下是Linux必学的60个命令的概览,但请注意,这里可能无法列出所有命令的完整语法和选项,仅作为参考
|
1天前
|
监控 Linux 数据处理
|
1天前
|
编解码 Ubuntu Linux
|
1天前
|
JSON Linux 数据格式
Linux命令发送http
请注意,`curl`命令非常灵活,可以根据您的需求进行多种配置和自定义。您可以查看 `curl`命令的文档以获取更多详细信息。
5 0
|
3天前
|
安全 Linux 测试技术