networkop / tkng

Source Repo for https://tkng.io
https://tkng.io
Apache License 2.0
332 stars 45 forks source link

Confusion in diagram notations. #31

Closed Vyom-Yadav closed 1 year ago

Vyom-Yadav commented 1 year ago

Sorry, super dump question. I probably know the answer to this, but I will still ask 'cause my networking knowledge is not super good.

Screenshot from 2023-06-13 23-00-01 Screenshot from 2023-06-13 22-59-48

What does L2 and L3 exactly specify in the above diagram? I know it link and network layer respectively. But what do they exactly specify?

Like in the first image, L3 specifies that flow from cbr0 -> flannel.1 is layer 3 routing and L2 specifies that flannel.1 internally does layer 2 routing (by adding internal MAC address and VXLAN header + UDP headers + outer IP header). Also then why does, flannel.1 -> eth0.4 does not have that L3 tag?

Bit confusing.

In the second image, like does it mean packets from vethX -> eth0.11 are routed using L3? This notation is pretty obvious but I want to still clarify whether I am thinking right or wrong.

Sorry for this question and really awesome work on this project, helps a lot!!

Vyom-Yadav commented 1 year ago

@networkop Sorry for pinging but can you please clarify? :)

networkop commented 1 year ago

L3 and L2 are supposed to represent IP and MAC address lookup respectively. The result of a L3 lookup should be a next-hop IP address, and the result of a L2 lookup should be the egress port. The two arrows around it is a common icon for a switch, e.g. https://static.thenounproject.com/png/56982-200.png (representing an "device" where these lookups happen)

So L3 and L2 do not represent a link but rather a forwarding engine (kernel routing table for L3, bridging table for L2). This is why the L3 for eth0 is drawn under the kind bridge, which is where the forwarding lookup for happens. Although, strictly speaking, the kind bridge only performs a L2 lookup but this is just an implementation detail as, in general, this can be a L3 network.

Vyom-Yadav commented 1 year ago

Thanks for clarifying, appreciate it!