5. Packet Generation (数据包生成)
🇨🇳 中文
当数据包向下通过网络层发送时,路由确定数据包下一跳的协议地址以及期望在哪个硬件上找到具有直接目标协议地址的站点。在10Mbit以太网的情况下,需要进行地址解析,某个较低层(可能是硬件驱动程序)必须咨询地址解析模块(可能在以太网支持模块中实现),以将 <协议类型,目标协议地址> 对转换为48位以太网地址。地址解析模块尝试在表中找到此对。如果找到该对,它将相应的48位以太网地址返回给调用者(硬件驱动程序),然后传输数据包。如果没有找到,它可能会通知调用者正在丢弃数据包(假设数据包将被更高的网络层重新传输),并生成类型字段为 ether_type$ADDRESS_RESOLUTION 的以太网数据包。
地址解析模块然后将 ar$hrd 字段设置为 ares_hrd$Ethernet,ar$pro 设置为正在解析的协议类型,ar$hln 设置为6(48位以太网地址中的字节数),ar$pln 设置为该协议中地址的长度,ar$op 设置为 ares_op$REQUEST,ar$sha 设置为自己的48位以太网地址,ar$spa 设置为自己的协议地址,ar$tpa 设置为正在尝试访问的机器的协议地址。它不将 ar$tha 设置为任何特定内容,因为这正是它试图确定的值。如果这使实现的某些方面更方便,它可以将 ar$tha 设置为硬件的广播地址(在10Mbit以太网的情况下全为1)。然后它使该数据包广播到以太网电缆上的所有站点,该电缆最初由路由机制确定。
🇬🇧 English
As a packet is sent down through the network layers, routing determines the protocol address of the next hop for the packet and on which piece of hardware it expects to find the station with the immediate target protocol address. In the case of the 10Mbit Ethernet, address resolution is needed and some lower layer (probably the hardware driver) must consult the Address Resolution module (perhaps implemented in the Ethernet support module) to convert the <protocol type, target protocol address> pair to a 48.bit Ethernet address. The Address Resolution module tries to find this pair in a table. If it finds the pair, it gives the corresponding 48.bit Ethernet address back to the caller (hardware driver) which then transmits the packet. If it does not, it probably informs the caller that it is throwing the packet away (on the assumption the packet will be retransmitted by a higher network layer), and generates an Ethernet packet with a type field of ether_type$ADDRESS_RESOLUTION.
The Address Resolution module then sets the ar$hrd field to ares_hrd$Ethernet, ar$pro to the protocol type that is being resolved, ar$hln to 6 (the number of bytes in a 48.bit Ethernet address), ar$pln to the length of an address in that protocol, ar$op to ares_op$REQUEST, ar$sha with the 48.bit ethernet address of itself, ar$spa with the protocol address of itself, and ar$tpa with the protocol address of the machine that is trying to be accessed. It does not set ar$tha to anything in particular, because it is this value that it is trying to determine. It could set ar$tha to the broadcast address for the hardware (all ones in the case of the 10Mbit Ethernet) if that makes it convenient for some aspect of the implementation. It then causes this packet to be broadcast to all stations on the Ethernet cable originally determined by the routing mechanism.
🇯🇵 日本語
パケットがネットワーク層を下って送信される際、ルーティングはパケットの次のホップのプロトコルアドレスと、直接のターゲットプロトコルアドレスを持つステーションをどのハードウェア上で見つけることを期待するかを決定します。10Mbitイーサネットの場合、アドレス解決が必要であり、何らかの下位層(おそらくハードウェアドライバ)がアドレス解決モジュール(おそらくイーサネットサポートモジュールに実装されている)に相談して、<プロトコルタイプ、ターゲットプロトコルアドレス>ペアを48ビットイーサネットアドレスに変換する必要があります。アドレス解決モジュールは、このペアをテーブルで見つけようとします。ペアが見つかった場合、対応する48ビットイーサネットアドレスを呼び出し元(ハードウェアドライバ)に返し、その後パケットを送信します。見つからなかった場合、おそらく呼び出し元にパケットを破棄していることを通知し(パケットはより高いネットワーク層によって再送信されるという仮定の下で)、タイプフィールドが ether_type$ADDRESS_RESOLUTION のイーサネットパケットを生成します。
その後、アドレス解決モジュールは、ar$hrd フィールドを ares_hrd$Ethernet に、ar$pro を解決されているプロトコルタイプに、ar$hln を6(48ビットイーサネットアドレスのバイト数)に、ar$pln をそのプロトコルのアドレスの長さに、ar$op を ares_op$REQUEST に、ar$sha を自分自身の48ビットイーサネットアドレスに、ar$spa を自分自身のプロトコルアドレスに、ar$tpa をアクセスしようとしているマシンのプロトコルアドレスに設定します。ar$tha は特に何にも設定しません。なぜなら、これは決定しようとしている値だからです。実装の何らかの側面にとって便利であれば、ar$tha をハードウェアのブロードキャストアドレス(10Mbitイーサネットの場合はすべて1)に設定することもできます。その後、ルーティングメカニズムによって元々決定されたイーサネットケーブル上のすべてのステーションにこのパケットをブロードキャストします。
🇫🇷 Français
Lorsqu'un paquet est envoyé vers le bas à travers les couches réseau, le routage détermine l'adresse de protocole du prochain saut pour le paquet et sur quel matériel il s'attend à trouver la station avec l'adresse de protocole cible immédiate. Dans le cas de l'Ethernet 10Mbit, une résolution d'adresse est nécessaire et une couche inférieure (probablement le pilote matériel) doit consulter le module de résolution d'adresse (peut-être implémenté dans le module de support Ethernet) pour convertir la paire <type de protocole, adresse de protocole cible> en une adresse Ethernet 48 bits. Le module de résolution d'adresse tente de trouver cette paire dans une table. S'il trouve la paire, il renvoie l'adresse Ethernet 48 bits correspondante à l'appelant (pilote matériel) qui transmet ensuite le paquet. S'il ne la trouve pas, il informe probablement l'appelant qu'il jette le paquet (en supposant que le paquet sera retransmis par une couche réseau supérieure), et génère un paquet Ethernet avec un champ de type ether_type$ADDRESS_RESOLUTION.
Le module de résolution d'adresse définit ensuite le champ ar$hrd à ares_hrd$Ethernet, ar$pro au type de protocole en cours de résolution, ar$hln à 6 (le nombre d'octets dans une adresse Ethernet 48 bits), ar$pln à la longueur d'une adresse dans ce protocole, ar$op à ares_op$REQUEST, ar$sha avec l'adresse Ethernet 48 bits de lui-même, ar$spa avec l'adresse de protocole de lui-même, et ar$tpa avec l'adresse de protocole de la machine à laquelle on tente d'accéder. Il ne définit pas ar$tha à quelque chose de particulier, car c'est cette valeur qu'il essaie de déterminer. Il pourrait définir ar$tha à l'adresse de diffusion pour le matériel (tous des uns dans le cas de l'Ethernet 10Mbit) si cela rend pratique certains aspects de l'implémentation. Il provoque ensuite la diffusion de ce paquet à toutes les stations sur le câble Ethernet initialement déterminé par le mécanisme de routage.
🇩🇪 Deutsch
Wenn ein Paket durch die Netzwerkschichten nach unten gesendet wird, bestimmt das Routing die Protokolladresse des nächsten Hops für das Paket und auf welcher Hardware es erwartet, die Station mit der unmittelbaren Zielprotokolladresse zu finden. Im Fall des 10Mbit-Ethernet ist eine Adressauflösung erforderlich, und eine niedrigere Schicht (wahrscheinlich der Hardware-Treiber) muss das Adressauflösungsmodul (möglicherweise im Ethernet-Unterstützungsmodul implementiert) konsultieren, um das <Protokolltyp, Zielprotokolladresse>-Paar in eine 48-Bit-Ethernet-Adresse umzuwandeln. Das Adressauflösungsmodul versucht, dieses Paar in einer Tabelle zu finden. Wenn es das Paar findet, gibt es die entsprechende 48-Bit-Ethernet-Adresse an den Aufrufer (Hardware-Treiber) zurück, der dann das Paket überträgt. Wenn nicht, informiert es wahrscheinlich den Aufrufer, dass es das Paket verwirft (unter der Annahme, dass das Paket von einer höheren Netzwerkschicht erneut übertragen wird), und erzeugt ein Ethernet-Paket mit einem Typfeld von ether_type$ADDRESS_RESOLUTION.
Das Adressauflösungsmodul setzt dann das ar$hrd-Feld auf ares_hrd$Ethernet, ar$pro auf den Protokolltyp, der aufgelöst wird, ar$hln auf 6 (die Anzahl der Bytes in einer 48-Bit-Ethernet-Adresse), ar$pln auf die Länge einer Adresse in diesem Protokoll, ar$op auf ares_op$REQUEST, ar$sha mit der 48-Bit-Ethernet-Adresse von sich selbst, ar$spa mit der Protokolladresse von sich selbst und ar$tpa mit der Protokolladresse der Maschine, auf die versucht wird zuzugreifen. Es setzt ar$tha nicht auf etwas Bestimmtes, da dies der Wert ist, den es zu bestimmen versucht. Es könnte ar$tha auf die Broadcast-Adresse für die Hardware (alle Einsen im Fall des 10Mbit-Ethernet) setzen, wenn das für einige Aspekte der Implementierung praktisch ist. Es veranlasst dann, dass dieses Paket an alle Stationen auf dem Ethernet-Kabel gesendet wird, das ursprünglich durch den Routing-Mechanismus bestimmt wurde.
🇮🇹 Italiano
Quando un pacchetto viene inviato verso il basso attraverso gli strati di rete, il routing determina l'indirizzo di protocollo del prossimo hop per il pacchetto e su quale pezzo di hardware si aspetta di trovare la stazione con l'indirizzo di protocollo target immediato. Nel caso dell'Ethernet 10Mbit, è necessaria la risoluzione degli indirizzi e qualche livello inferiore (probabilmente il driver hardware) deve consultare il modulo di risoluzione degli indirizzi (forse implementato nel modulo di supporto Ethernet) per convertire la coppia <tipo di protocollo, indirizzo di protocollo target> in un indirizzo Ethernet a 48 bit. Il modulo di risoluzione degli indirizzi cerca di trovare questa coppia in una tabella. Se trova la coppia, restituisce l'indirizzo Ethernet a 48 bit corrispondente al chiamante (driver hardware) che poi trasmette il pacchetto. Se non la trova, probabilmente informa il chiamante che sta scartando il pacchetto (presupponendo che il pacchetto verrà ritrasmesso da un livello di rete superiore), e genera un pacchetto Ethernet con un campo tipo di ether_type$ADDRESS_RESOLUTION.
Il modulo di risoluzione degli indirizzi imposta quindi il campo ar$hrd a ares_hrd$Ethernet, ar$pro al tipo di protocollo che viene risolto, ar$hln a 6 (il numero di byte in un indirizzo Ethernet a 48 bit), ar$pln alla lunghezza di un indirizzo in quel protocollo, ar$op a ares_op$REQUEST, ar$sha con l'indirizzo Ethernet a 48 bit di se stesso, ar$spa con l'indirizzo di protocollo di se stesso, e ar$tpa con l'indirizzo di protocollo della macchina a cui si sta cercando di accedere. Non imposta ar$tha a nulla in particolare, perché è questo il valore che sta cercando di determinare. Potrebbe impostare ar$tha all'indirizzo broadcast per l'hardware (tutti uno nel caso dell'Ethernet 10Mbit) se ciò rende conveniente qualche aspetto dell'implementazione. Quindi fa in modo che questo pacchetto venga trasmesso a tutte le stazioni sul cavo Ethernet originariamente determinato dal meccanismo di routing.