Re:IP addresses and routing
by wyldfire on Thursday July 26, 2018 @12:43PM
(#17618809)
> The packet goes to your modem, which is plugged into some network adapter (this is the network "device," right?).
From the point of view of your OS' routing table, the "network device" is the OS device that represents the local network device. Ms Evans cites three examples; one's a real hardware WLAN device (likely connected to the system via PCIe or USB-via-PCIe).
The "modem" you're referring to is probably your or your ISP's "cable modem"? If so, the cable modem function of this device is (very nearly) transparent to the IP layer and we can ignore it for the sake of the routing table. I believe many/most of these modems function as a layer 2 bridge.
The sequence of events when packets arrive from the ISP is:
1. packet is forwarded from ISP to your cable modem.
2. cable modem receives the packet, sees that the destination address belongs on "this side" of the bridge and forwards it.
3. Computer's NIC ("network interface card") receives a packet, copies it into memory and interrupts the processor.
4. OS interrupt service routine handles the interrupt by posting a flag and copying the incoming data to another buffer.
5. OS' network stack realizes this packet is an IP packet and starts to process it according to local rules (next layer up, etc).
...lots of details omitted from above for the sake of clarity, but I can add more if you want. Slight variations of the above occur depending on the specific deployment of router-vs-cable-modem-vs-DSL-vs-NIC-config etc.
Re:IP addresses and routing
by knicholes on Thursday July 26, 2018 @04:56PM
(#17621032)
Ah, there it is! Okay, I know it's being pedantic, but the whole NIC aspect is what I was looking for. Taking my OS theory class at 8am was a bad choice. Thank you so much for the excellent explanation!
From the point of view of your OS' routing table, the "network device" is the OS device that represents the local network device. Ms Evans cites three examples; one's a real hardware WLAN device (likely connected to the system via PCIe or USB-via-PCIe).
The "modem" you're referring to is probably your or your ISP's "cable modem"? If so, the cable modem function of this device is (very nearly) transparent to the IP layer and we can ignore it for the sake of the routing table. I believe many/most of these modems function as a layer 2 bridge.
The sequence of events when packets arrive from the ISP is:
1. packet is forwarded from ISP to your cable modem.
2. cable modem receives the packet, sees that the destination address belongs on "this side" of the bridge and forwards it.
3. Computer's NIC ("network interface card") receives a packet, copies it into memory and interrupts the processor.
4. OS interrupt service routine handles the interrupt by posting a flag and copying the incoming data to another buffer.
5. OS' network stack realizes this packet is an IP packet and starts to process it according to local rules (next layer up, etc).
...lots of details omitted from above for the sake of clarity, but I can add more if you want. Slight variations of the above occur depending on the specific deployment of router-vs-cable-modem-vs-DSL-vs-NIC-config etc.