R
R
revyu2020-11-19 19:26:52
Computer networks
revyu, 2020-11-19 19:26:52

How does ethernet frame transmission work?

a schoolboy, trying to program. I started studying computer networks (Sozykin course + wiki + thematic videos from YouTube).
those. here I have some kind of ethernet packet that has some sort of recipient's mac address. I press enter, it goes to the router, the router looks for the same mac address in the connections, it doesn't find it, the router sends a frame to the switch in the attic by patch cord, the switch doesn't find it either. where the switch redirects and how the history is silent.
there is a vague explanation that the switch redirects it to some other router of the district level, further to the city level, etc. redirects, it seems, over the wan network, but there the speed is up to 56 kbps, and the router gives me 100 mb / s.
I would like to hear what happens next as clear and detailed as possible or a link to sources (although I searched and didn’t find anything)
I immediately apologize for the stupid question, it’s just that everything around seems to have been in the subject for a long time and they didn’t tell me.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eugene, 2020-11-19
@revyu

Perhaps you can start with this:
https://linkmeup.ru/blog/11.html Otherwise
, I highly recommend taking (or finding on the Internet) Cisco Networking Academy courses. In particular Cisco CCNA. I took courses in English 10 years ago, the courses give a good foundation in the field of networks. That was the start of my journey in IT. Since 2020, it seems like the course is being released in Russian.

V
Vladimir Korotenko, 2020-11-19
@firedragon

google ethernet frame rfc
question is really cool so good luck

V
vreitech, 2020-11-20
@fzfx

> I press enter, it goes to the router
, it goes first of all to the switching matrix of the device connected from the opposite side of the cable: it's a router or a switch - it doesn't matter. the main thing - that speech not about a network from two computers.
> , the router looks for the same mac address in the connections with
the switch built into the router looks for
> does not find it, the router sends a frame to the switch in the attic by patch cord, the switch
built into the router sends the received ethernet frame further to all its ports to which something is connected , in addition to the port from which the frame came, and, given that the switch is not on its own, but as part of the router, then in addition to the ports that are assigned to other broadcast segments in the router settings (i.e., to another network, to another VLAN).
> , the switch also does not find.
to the same place as in the case of a switch in the router - to all ports, except for the source port and ports related to other VLANs (if the switch is managed and supports splitting ports by VLAN). thus, the ethernet frame will be distributed throughout the local network from the switch to other switches (and computers), and the same procedure will be repeated on each of them: if there is an entry in the switch that correlates the destination MAC address from the frame with which -the port of the switch, the frame will be redirected to this port, and in the absence of such an entry - to all ports at once, except for the source port. if in this local network there really is a computer with such a MAC address, then the frame will eventually reach it, and if not, the frame will eventually be lost.
> there is a vague explanation that the switch redirects it to some other router of the district further city level, etc. redirects, it seems, over the wan network, but there the speed is up to 56 kbps, and the router gives me 100 mb / s.
here the tricks are already beginning on the part of the one who gave you a vague explanation.
if, as you mentioned at the very beginning, "there is some kind of ezernet packet that has some kind of poppy address of the recipient", then it will not get out of the local network (i.e. through a router). the router, like any other L3 device (working with IP addresses), accepts from its built-in switch only frames whose destination MAC address matches the router's MAC address, and discards all others. so your frame will not get to any other network until you rewrite what you said to "there is some kind of ethernet packet that has the MAC of the router as the recipient's MAC address." in this case, the frame will get to the router, which will extract the destination IP address from it and, based on its routing table, direct it to one of the networks connected to it,
> I would like to hear what happens next
about what's next in the "some kind of MAC" option, I indicated above: no further than within the same local area network.
and if the MAC is correct (and the routing table of the computer from which the packet is sent at the beginning is responsible for this), all this is repeated a certain number of times depending on the length of the route, its correctness and the presence of problems in the network: from each new router the frame is sent to the MAC of the next router, passes through the switches, and if there is no break or other malfunction anywhere, it gets to the next router, on which, depending on the destination IP address, the router selects the next network and changes the destination MAC, or kills the frame if there is no route to this IP destination in its routing table.
you already seem to have thrown off references to literature. there you will read about all other possible situations, such as broadcast frames, reserved multicast addresses, other reserved addresses, ARP cache, ARP warming, ARP proxying, various variations of Ethernet frame standards and much more - I described, but there are these and other exceptions to it.

D
DDwrt100, 2020-11-20
@DDwrt100

the mechanism looks like this:
When a key is pressed, a data packet is formed, there are fields source and destination ip.
Next, the network subsystem looks to see if the destination ip is in my subnet (in general, at first it looks to see if the ip belongs to me, but it doesn’t matter). If the dst ip is on a subnet, the computer looks up its arp table and looks at what dstip's mac address is behind. and then sends to this poppy address. If the desired host is not in arp, a broadcast message is sent as to who has the dstip here. If they answered, then the entry is written to the arp table and then along the knurled one.
If the remote host is outside the computer's subnet, then the host checks its routing table to see if I have a route to that subnet. In most cases, a default gateway is written on the host, it is essentially a route 0,0,0,0/0 via ip_address_router. Next, the packet is transmitted as in the first case to the router. The router looks at which of its routes most closely matches dstip and sends a packet there according to the same rules as with the host.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question