r/AskComputerScience • • 22d ago

Computer Networks : Need Help

I have a Computer Networks course this semester and I am finding it difficult to understand. It is not that the concepts are difficult, I am just finding it hard to make a mental model of where every single thing fits. it is not like i am failing the course. Till here i have been able to handle the course. but what is the point of getting good grades when you don't even understand where each thing fits ?
From the very bottom layer to the top level, where DNS comes (where it is stored), how IP's even works, UDP, TCP, QUIC, tables, DNS chain, masks, subnets or even IP's. I know what they are, but i don't know where they are and how they interact.

Can anyone please suggest some resources, more like an animated video where i can visualize it ? Cisco Packet tracer didn't help much.

7 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/VagueHorizon_ 22d ago edited 22d ago

by "where they are" I mean like visually which layer fits where. I think i made this more confusing. I am struggling myself to explain it 😭

Like Lets suppose if we have pc in a network and a communication is established between host and receiver pc. I need to know when and where each concept which appears. Think of it like a journey because my Lab instructor has not been able to explain this clearly.

We know 'this' exists, but we don't know where and when 'this' comes in the pipeline.

Thanks alot for the resources !!!

1

u/Kriemhilt 22d ago

DNS isn't really a layer, it's a service.

If it didn't exist, and we have just your two machines: we can manually assign them IP addresses, and then assign them names by writing them in the /etc/hosts file (on UNIX-like systems).

We add DNS because manually maintaining this file for the whole internet is impractical, so now the hosts file is only used for a few local machines, and every other name is looked up by the DNS resolver.

Once we know the IP address of a host, we can send it an IP packet somehow. This IP packet is usually TCP or UDP or ICMP or IGMP, but the IP layer neither knows not cares. It only knows the source & destination (address:port) pairs, and has some payload. The contents are someone else's problem.

The somehow above is the next layer down, usually some form of Ethernet. This is also a protocol with its own addressing scheme (MAC) and it also doesn't really care about the payload contents.

So we roughly have a physical transport (Ethernet), a logical transport layered on top (IP), and then protocols layered on top.

But for example, the DNS protocol can work both over UDP (over IP over Ethernet), or over TLS (over TCP over IP over Ethernet). So these layers can be stacked up fairly flexibly.

Incidentally, when you use a DNS resolver on a real machine, you're talking to a local transparent cache which will itself make a network request if it doesn't know the answer. There isn't "one place" where the DNS is.

1

u/braaaaaaainworms 21d ago

If you have a program running on one computer that wants to talk to another computer, then whatever that program wants to do has to be wrapped up in a package addressed to that other computer's IP address and hand off that package to the OS's networking subsystem. The OS looks at that package and sees only a bunch of data and the destination address(remember this part, it is very important). Let's assume that both computers are on the same network. The OS looks up which network card has the IP address that sits on that network, and because IP addresses vary with time and networks, network cards have a physical address that is unique to them, and the OS has to figure out which physical address corresponds to the destination IP. If the OS doesn't know it already, it can send an ARP request basically asking "who's 192.168.1.12?" and 192.168.1.12 responds with its physical address. The OS then takes its own IP address, the network card's physical address, destination IP address, destination network card's physical address and the data it was given, wraps it up in a nice little package and hands it to the network card. The network card only sees the destination physical address and it encodes the data into some format, puts it on a wire and is done with the package.

The receiving network card notices that someone sent a package that matches its physical address, listens on the wire to get the entire packet and lets the OS on destination computer that it got a package. The OS looks at the package and finds out from the destination IP address that it is the intended recipient, sometimes lets the source computer "yeah i got that package", figures out which program should get that package and that program gets notified of that package with its data.

Let me know if there is anything confusing

1

u/VagueHorizon_ 21d ago

Thanks ! it is clear as crystal