update the folder organisation
This commit is contained in:
		
							
								
								
									
										87
									
								
								Blatt02/ARP.drawio
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								Blatt02/ARP.drawio
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,87 @@ | ||||
| <mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.17 Chrome/128.0.6613.36 Electron/32.0.1 Safari/537.36" version="24.7.17"> | ||||
|   <diagram name="Page-1" id="c7488fd3-1785-93aa-aadb-54a6760d102a"> | ||||
|     <mxGraphModel dx="988" dy="570" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" background="none" math="0" shadow="0"> | ||||
|       <root> | ||||
|         <mxCell id="0" /> | ||||
|         <mxCell id="1" parent="0" /> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-3" target="W-n-PndQ-2xYdpGvvika-4" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-3" value="" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.annotation_2;align=left;labelPosition=right;pointerEvents=1;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="170" y="350" width="50" height="100" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-4" target="W-n-PndQ-2xYdpGvvika-6" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-4" value="通知caller扔掉包" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="300" y="440" width="100" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-6" value="生成一个Ethernet Packet<div>(type field =<br style="font-size: 8px;">ether_type$ADDR_RESOLUTION</div>" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;fontSize=8;align=center;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="500" y="435" width="150" height="70" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-8" target="W-n-PndQ-2xYdpGvvika-10" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-8" value="设置ar$hrd为ares_hrd$Ethernet,<div>ar$pro为protocol type</div>" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;fontSize=8;align=center;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="500" y="550" width="150" height="70" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=-0.081;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-6" target="W-n-PndQ-2xYdpGvvika-8" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-10" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry"> | ||||
|             <mxPoint x="575.1111111111111" y="770.0555555555554" as="targetPoint" /> | ||||
|           </mxGeometry> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-10" value="设置ar$hrd为ares_hrd$Ethernet,<div>ar$pro为protocol type</div><div>ar$hln为6,MAC地址的字节数</div><div>ar$pln为地址协议的长度</div><div>ar$op为ares_op$REQUEST</div><div>ar$sha为48位网络地址</div><div>ar$spa是协议地址(ipv4)</div><div>ar$tpa是机器尝试访问的协议地址</div><div>ar$tha不需要特别设定</div><div>ar$tha可以设置成广播地址</div>" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;fontSize=8;align=center;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="500" y="680" width="150" height="110" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-13" target="W-n-PndQ-2xYdpGvvika-14" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-13" value="有在ar$hrd的硬件类型吗?(支持这个硬件类型吗?)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="200" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-14" target="W-n-PndQ-2xYdpGvvika-17" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-14" value="这个包的协议是在ar$pro中吗?(支持这个协议类型吗?)(可能检查地址长度" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="390" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-15" value="如果Merge_flag是false<div>发送方协议地址,</div><div>发送方硬件地址</div><div>存入ARP</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="580" y="230" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-16" target="W-n-PndQ-2xYdpGvvika-15" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-16" target="W-n-PndQ-2xYdpGvvika-18" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-16" value="这个包是目的协议地址吗?" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="580" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-17" value="把标志位Merge_flag设置为False<div>在ARP缓存表中查找发送方协议地址<br>如果存在更新ip-mac表</div><div>把标志位Merge_flag设置为true</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="390" y="210" width="120" height="100" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-18" target="W-n-PndQ-2xYdpGvvika-19" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-18" target="W-n-PndQ-2xYdpGvvika-20" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-18" value="opcode是ares_op$REQUEST吗?" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="770" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-19" value="交换硬件和协议部分,把本地硬件和协议地址放到发送区<div>设置ar$op部分为ares_op$REPLY</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="770" y="230" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-20" value="发送" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="960" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.029;entryY=0.516;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-14" target="W-n-PndQ-2xYdpGvvika-16" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|       </root> | ||||
|     </mxGraphModel> | ||||
|   </diagram> | ||||
| </mxfile> | ||||
							
								
								
									
										87
									
								
								Blatt02/ARP2.drawio
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								Blatt02/ARP2.drawio
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,87 @@ | ||||
| <mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.17 Chrome/128.0.6613.36 Electron/32.0.1 Safari/537.36" version="24.7.17"> | ||||
|   <diagram name="Page-1" id="c7488fd3-1785-93aa-aadb-54a6760d102a"> | ||||
|     <mxGraphModel dx="687" dy="394" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" background="none" math="0" shadow="0"> | ||||
|       <root> | ||||
|         <mxCell id="0" /> | ||||
|         <mxCell id="1" parent="0" /> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-3" target="W-n-PndQ-2xYdpGvvika-4" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-3" value="" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.annotation_2;align=left;labelPosition=right;pointerEvents=1;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="170" y="350" width="50" height="100" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-4" target="W-n-PndQ-2xYdpGvvika-6" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-4" value="通知caller扔掉包" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="300" y="440" width="100" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-6" value="生成一个Ethernet Packet<div>(type field =<br style="font-size: 8px;">ether_type$ADDR_RESOLUTION</div>" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;fontSize=8;align=center;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="500" y="435" width="150" height="70" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-8" target="W-n-PndQ-2xYdpGvvika-10" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-8" value="设置ar$hrd为ares_hrd$Ethernet,<div>ar$pro为protocol type</div>" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;fontSize=8;align=center;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="500" y="550" width="150" height="70" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=-0.081;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-6" target="W-n-PndQ-2xYdpGvvika-8" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-10" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry"> | ||||
|             <mxPoint x="575.1111111111111" y="770.0555555555554" as="targetPoint" /> | ||||
|           </mxGeometry> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-10" value="设置ar$hrd为ares_hrd$Ethernet,<div>ar$pro为protocol type</div><div>ar$hln为6,MAC地址的字节数</div><div>ar$pln为地址协议的长度</div><div>ar$op为ares_op$REQUEST</div><div>ar$sha为48位网络地址</div><div>ar$spa是协议地址(ipv4)</div><div>ar$tpa是机器尝试访问的协议地址</div><div>ar$tha不需要特别设定</div><div>ar$tha可以设置成广播地址</div>" style="shape=parallelogram;html=1;strokeWidth=2;perimeter=parallelogramPerimeter;whiteSpace=wrap;rounded=1;arcSize=12;size=0;fontSize=8;align=center;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="500" y="680" width="150" height="110" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-13" target="W-n-PndQ-2xYdpGvvika-14" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-13" value="有在ar$hrd的硬件类型吗?(支持这个硬件类型吗?)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="200" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-14" target="W-n-PndQ-2xYdpGvvika-17" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-14" value="这个包的协议是在ar$pro中吗?(支持这个协议类型吗?)(可能检查地址长度" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="390" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-15" value="如果Merge_flag是false<div>发送方协议地址,</div><div>发送方硬件地址</div><div>存入ARP</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="580" y="230" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-16" target="W-n-PndQ-2xYdpGvvika-15" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-16" target="W-n-PndQ-2xYdpGvvika-18" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-16" value="这个包是目的协议地址吗?" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="580" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-17" value="把标志位Merge_flag设置为False<div>在ARP缓存表中查找发送方协议地址<br>如果存在更新ip-mac表</div><div>把标志位Merge_flag设置为true</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="390" y="210" width="120" height="100" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-18" target="W-n-PndQ-2xYdpGvvika-19" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-18" target="W-n-PndQ-2xYdpGvvika-20" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-18" value="opcode是ares_op$REQUEST吗?" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="770" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-19" value="交换硬件和协议部分,把本地硬件和协议地址放到发送区<div>设置ar$op部分为ares_op$REPLY</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="770" y="230" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-20" value="发送" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1"> | ||||
|           <mxGeometry x="960" y="110" width="120" height="60" as="geometry" /> | ||||
|         </mxCell> | ||||
|         <mxCell id="W-n-PndQ-2xYdpGvvika-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.029;entryY=0.516;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="W-n-PndQ-2xYdpGvvika-14" target="W-n-PndQ-2xYdpGvvika-16" edge="1"> | ||||
|           <mxGeometry relative="1" as="geometry" /> | ||||
|         </mxCell> | ||||
|       </root> | ||||
|     </mxGraphModel> | ||||
|   </diagram> | ||||
| </mxfile> | ||||
| @@ -194,3 +194,171 @@ buf :FF FF FF FF FF FF AE AB 32 09 8E B4 08 06 00 01 08 00 06 04 00 01 AE AB 32 | ||||
|  | ||||
|  | ||||
|  | ||||
| root@pc1:~# tcpdump -i eth1 | ||||
| tcpdump: verbose output suppressed, use -v[v]... for full protocol decode | ||||
| listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes | ||||
| 10:53:47.911087 IP6 2001:db8:5::2 > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2001:db8:5::1, length 32 | ||||
| 10:53:47.911189 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, neighbor advertisement, tgt is 2001:db8:5::1, length 32 | ||||
| 10:53:47.912325 IP6 2001:db8:5::2 > 2001:db8:5::1: ICMP6, echo request, id 56760, seq 1, length 64 | ||||
| 10:53:47.912349 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, echo reply, id 56760, seq 1, length 64 | ||||
| 10:53:48.904692 IP6 2001:db8:5::2 > 2001:db8:5::1: ICMP6, echo request, id 56760, seq 2, length 64 | ||||
| 10:53:48.904719 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, echo reply, id 56760, seq 2, length 64 | ||||
| 10:53:49.906078 IP6 2001:db8:5::2 > 2001:db8:5::1: ICMP6, echo request, id 56760, seq 3, length 64 | ||||
| 10:53:49.906103 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, echo reply, id 56760, seq 3, length 64 | ||||
| 10:53:50.907512 IP6 2001:db8:5::2 > 2001:db8:5::1: ICMP6, echo request, id 56760, seq 4, length 64 | ||||
| 10:53:50.907538 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, echo reply, id 56760, seq 4, length 64 | ||||
| 10:53:51.908904 IP6 2001:db8:5::2 > 2001:db8:5::1: ICMP6, echo request, id 56760, seq 5, length 64 | ||||
| 10:53:51.908929 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, echo reply, id 56760, seq 5, length 64 | ||||
| 10:53:52.926411 IP6 fe80::216:3eff:fe00:2 > 2001:db8:5::2: ICMP6, neighbor solicitation, who has 2001:db8:5::2, length 32 | ||||
| 10:53:52.927121 IP6 2001:db8:5::2 > fe80::216:3eff:fe00:2: ICMP6, neighbor advertisement, tgt is 2001:db8:5::2, length 24 | ||||
|  | ||||
|  | ||||
|  | ||||
| 13:14:32.958532 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, neighbor advertisement, tgt is 2001:db8:5::2, length 32 | ||||
|         0x0000:  0016 3e00 0004 0016 3e00 0602 86dd 6000  ..>.....>.....`. | ||||
|         0x0010:  0000 0020 3aff 2001 0db8 0005 0000 0000  ....:........... | ||||
|         0x0020:  0000 0000 0001 2001 0db8 0005 0000 0000  ................ | ||||
|         0x0030:  0000 0000 0002 8800 484c 6000 0000 2001  ........HL`..... | ||||
|         0x0040:  0db8 0005 0000 0000 0000 0000 0002 0201  ................ | ||||
|         0x0050:  0016 3e00 0602                           ..>... | ||||
|  | ||||
| ``` | ||||
| 13:14:32.958532 IP6 2001:db8:5::1 > 2001:db8:5::2: ICMP6, neighbor advertisement, tgt is 2001:db8:5::2, length 32 | ||||
|         0x0000:  0016 3e00 0004 0016 3e00 0602 86dd 6000  ..>.....>.....`. | ||||
|         0x0010:  0000 0020 3aff 2001 0db8 0005 0000 0000  ....:........... | ||||
|         0x0020:  0000 0000 0001 2001 0db8 0005 0000 0000  ................ | ||||
|         0x0030:  0000 0000 0002 8800 484c 6000 0000 2001  ........HL`..... | ||||
|         0x0040:  0db8 0005 0000 0000 0000 0000 0002 0201  ................ | ||||
|         0x0050:  0016 3e00 0602                           ..>... | ||||
| ``` | ||||
|  | ||||
|  00:16:3e:00:00:02  | ||||
|  | ||||
|  | ||||
|  | ||||
| 这个包是一个 **ICMPv6 邻居通告(Neighbor Advertisement, NA)** 消息,表明发送方(`2001:db8:5::1`)告知接收方(`2001:db8:5::2`),其目标地址(`tgt`)的链路层(MAC)信息。 | ||||
|  | ||||
| 以下是对这个包的逐字段详细分析: | ||||
|  | ||||
| ------ | ||||
|  | ||||
| ### **1. 数据包的结构** | ||||
|  | ||||
| ICMPv6 邻居通告消息由以下几部分组成: | ||||
|  | ||||
| | **字段**            | **长度** | **解释**                                               | | ||||
| | ------------------- | -------- | ------------------------------------------------------ | | ||||
| | **以太网帧头**      | 14 字节  | 包括源 MAC 地址、目标 MAC 地址和以太网类型。           | | ||||
| | **IPv6 头**         | 40 字节  | IPv6 源地址、目的地址,及与数据包相关的信息。          | | ||||
| | **ICMPv6 头**       | 4 字节   | 包括类型(Type)、代码(Code)、校验和(Checksum)。   | | ||||
| | **ICMPv6 数据部分** | 可变长度 | 邻居通告消息的具体内容,包括目标地址和链路层地址选项。 | | ||||
|  | ||||
| ------ | ||||
|  | ||||
| ### **2. 分析具体字段** | ||||
|  | ||||
| #### **以太网帧头** | ||||
|  | ||||
| ``` | ||||
| 0x0000:  0016 3e00 0004 0016 3e00 0602 86dd | ||||
| ``` | ||||
|  | ||||
| | 偏移量   | 字段          | 值                  | 解释                                    | | ||||
| | -------- | ------------- | ------------------- | --------------------------------------- | | ||||
| | `0x0000` | 目标 MAC 地址 | `00:16:3e:00:00:04` | 目标设备的链路层地址(目的 MAC 地址)。 | | ||||
| | `0x0006` | 源 MAC 地址   | `00:16:3e:00:06:02` | 源设备的链路层地址(发送方 MAC 地址)。 | | ||||
| | `0x000c` | 以太网类型    | `0x86dd`            | 表示接下来的数据是 IPv6 数据包。        | | ||||
|  | ||||
| ------ | ||||
|  | ||||
| #### **IPv6 头部** | ||||
|  | ||||
| ``` | ||||
| 0x0010:  6000 0000 0020 3aff 2001 0db8 0005 0000 | ||||
| 0x0020:  0000 0000 0001 2001 0db8 0005 0000 0000 | ||||
| 0x0030:  0000 0000 0002 | ||||
| ``` | ||||
|  | ||||
| | 偏移量   | 字段             | 值              | 解释                                         | | ||||
| | -------- | ---------------- | --------------- | -------------------------------------------- | | ||||
| | `0x0010` | 版本/流量类/流标 | `6000 0000`     | IPv6 版本号(6),流量类别(0),流标(0)。 | | ||||
| | `0x0014` | 载荷长度         | `0020`          | 载荷长度 32 字节。                           | | ||||
| | `0x0016` | 下一头部类型     | `3a`            | 表示下一头部为 ICMPv6(58)。                | | ||||
| | `0x0017` | 跳数限制         | `ff`            | 初始跳数设置为 255,避免跨链路转发。         | | ||||
| | `0x0018` | 源地址           | `2001:db8:5::1` | 发送方 IPv6 地址。                           | | ||||
| | `0x0028` | 目的地址         | `2001:db8:5::2` | 接收方 IPv6 地址。                           | | ||||
|  | ||||
| ------ | ||||
|  | ||||
| #### **ICMPv6 头部** | ||||
|  | ||||
| ``` | ||||
| 0x0030:  8800 484c | ||||
| ``` | ||||
|  | ||||
| | 偏移量   | 字段         | 值     | 解释                                             | | ||||
| | -------- | ------------ | ------ | ------------------------------------------------ | | ||||
| | `0x0030` | 类型(Type) | `88`   | 表示这是一个邻居通告(Neighbor Advertisement)。 | | ||||
| | `0x0031` | 代码(Code) | `00`   | 固定为 0(邻居通告无子代码)。                   | | ||||
| | `0x0032` | 校验和       | `484c` | 校验和,确保 ICMPv6 数据的完整性。               | | ||||
|  | ||||
| ------ | ||||
|  | ||||
| #### **ICMPv6 数据部分** | ||||
|  | ||||
| ``` | ||||
| 0x0034:  6000 0000 2001 0db8 0005 0000 0000 0000 0002 | ||||
| 0x0050:  0201 0016 3e00 0602 | ||||
| ``` | ||||
|  | ||||
| ##### **(a) 邻居通告标志和目标地址** | ||||
|  | ||||
| ``` | ||||
| 0x0034:  6000 0000 2001 0db8 0005 0000 0000 0000 0002 | ||||
| ``` | ||||
|  | ||||
| | 偏移量   | 字段     | 值              | 解释                               | | ||||
| | -------- | -------- | --------------- | ---------------------------------- | | ||||
| | `0x0034` | 目标地址 | `2001:db8:5::2` | 目标设备的 IPv6 地址,告知请求方。 | | ||||
|  | ||||
| ##### **(b) 链路层地址选项** | ||||
|  | ||||
| ``` | ||||
| 0x0050:  0201 0016 3e00 0602 | ||||
| ``` | ||||
|  | ||||
| | 偏移量   | 字段     | 值                  | 解释                                                 | | ||||
| | -------- | -------- | ------------------- | ---------------------------------------------------- | | ||||
| | `0x0050` | 选项类型 | `02`                | 链路层地址选项(Target Link-Layer Address Option)。 | | ||||
| | `0x0051` | 选项长度 | `01`                | 长度为 1(单位:8 字节)。                           | | ||||
| | `0x0052` | MAC 地址 | `00:16:3e:00:06:02` | 目标设备的链路层地址(MAC 地址)。                   | | ||||
|  | ||||
| ------ | ||||
|  | ||||
| ### **3. 总结这个包的含义** | ||||
|  | ||||
| 1. **包类型**: | ||||
|    - 这是一个 **ICMPv6 邻居通告(NA)** 数据包。 | ||||
| 2. **发送方信息**: | ||||
|    - IPv6 地址:`2001:db8:5::1`。 | ||||
|    - MAC 地址:`00:16:3e:00:06:02`。 | ||||
| 3. **接收方信息**: | ||||
|    - 目标 IPv6 地址:`2001:db8:5::2`。 | ||||
|    - 目标链路层地址(MAC):`00:16:3e:00:04`。 | ||||
| 4. **作用**: | ||||
|    - 通知目标设备(`2001:db8:5::2`),IPv6 地址 `2001:db8:5::1` 解析为 MAC 地址 `00:16:3e:00:06:02`。 | ||||
| 5. **网络流程**: | ||||
|    - 这是对之前邻居请求(NS)消息的回复,目标设备将更新其邻居表,以便后续通信。 | ||||
|  | ||||
| ------ | ||||
|  | ||||
| ### **补充** | ||||
|  | ||||
| - **邻居通告的用途**: | ||||
|   - 用于响应邻居请求。 | ||||
|   - 通知链路上的其他设备该地址的链路层信息。 | ||||
| - **校验关键点**: | ||||
|   - 确认 IPv6 头部和 ICMPv6 数据是否正确匹配。 | ||||
|   - 确保链路层地址和目标地址一致。 | ||||
|  | ||||
| 如果你需要进一步分析或有其他问题,请随时补充! | ||||
|   | ||||
		Reference in New Issue
	
	Block a user