OSI Model
1. Physical Layer: Any media or device that carries 1 & 0s between two nodes. 1 & 0s are bits. Cables/Hub/Repeater.
2. Data Link Layer: Responsible for putting and pulling 1 & 0s (bits) from the wire to the next source. NIC/MAC. Likewise, it is delivering packets from one NIC to another NIC, hop-to-hop transfer. Frames.
3. Network Layer: Packets delivery from end to end. IP address/Routers. Facilitate communication between networks.
Packet {DATA + IP + MAC}:
The computer encapsulates it in an IP header which includes the source/destination IP of the two ends.IP header and data are further encapsulated in the MAC address header which includes the source/destination MAC of the current hop.
Encapsulation and Decapsulation (sending top to bottom and receiving bottom to top)
4. Transport Layer: Responsible for distinguished network streams. The user requested a web address and that web server sends the data to the user. Final point; the user gets that information by 1 and 0s to the user NIC.
A new user has to identify those 1 & 0s. Layer 4 does this by port numbers. TCP/UDP; 65,536
Layer2 (hop-to-hop) >> Layer3 (end-end) >> Layer4 (service-service)
<---------------------------- delivery -------------------------------------------->
Layer5/6/7: Session/Presentation/ Application Layer;
TCP/IP {Apllication/Transport/Internet/Network interface /Hardware}
Host to Host communication via Switch
Switch (Layer2): Data Link Layer: Responsible for putting and pulling 1 & 0s (bits) from the wire to the next source. NIC/MAC. Likewise, it is delivering packets from one NIC to another NIC, hop-to-hop transfer. Frames.
Use source/destination MAC address to make forwarding decisions.
Facilitates communication within networks.
Learning > Flooding > Forwarding > Filtering
- Learning: learn the L2 header and user SRC/DST MAC to make forwarding decisions.
- Flooding: if the switch receives a frame and it doesn't know about the port, then the switch duplicates the frame and sends it to all ports.
- Forwarding: switch has a proper MAC address table. Here switch can forward frames via;
- Store & forward: Store nothing, read the DST MAC and forward the frame. (fastest method). But no error detection. Nowadays switch copied the entire frame into the memory buffer, and checks for errors before forwarding, (slowest). but can prioritize the traffic to move fast.
- at through
- fragment free: prior two. inspect only the first 64 bits of the frame. good for error detection while storing the full frame and inspecting it before forwarding the frame.
Host to Host communication via Switch: Operation
- Host A wants to send something to host B. L2 header SRC/DST MAC. when the frame is received to switch, it will try to find the host B MAC address. then the switch is duplicated and floods the frame to all its ports except port 1 (filtering).
- switch recived the hostA from and then the switch flooded the frame to other ports. Thus host B and C get the frame.
- hostB accepted the frame and generate a response.
- when response arrive another MAC table learned, the switch forward the frame to host A.
Broadcast: between the switch flooding behavior, there end result is the same, but there ia a distiction.
Broadcast frame: address to everyone on the LAN done by using same ethernet header except the DST MAC address field is populated with a special address ffff:ffff:ffff. the all F's purpose is for broadcasting. if a switch received a fram with f:, switch cannot find a map. so switch will flood the frame.
Broadcast is a frame address to everyone on LAN and flooding is an action a switch can take.
What is a Switch? the primary purpose is to facilitate communication within the networks. (hop-to-hop) L2 OSI. SRC/DST MAC, MAC address table. Map MAC --> Switch port. Frame {Data+MAC}
when data comes to a switch, it looks for the DST MAC address and the port. if the destination MAC doesn't know, the switch floods the frame to each port.
The router? the primary purpose is to facilitate communication between the networks. L3.
- A sends data to B. A knows B's IP.
- A creates an L3 header (src/dst IP)
- L2 must be created because L2's primary job is to perform the communication within the network.
- L2 header (abc=SRC and xyz=DST), here A doesn't know the B MAC address yet.
- Hence, A cannot create a proper L2 header to deliver the packet to B's NIC. So A sends the ARP request to find B's MAC.
- HostA packet --> R1 (a packet deliver to the R1 default gateway)
- hostA creates L3 header {SRC|DST hostA IP address}
- L3 header is not enough to deliver the packet to hostB.
- hostA encapsulate L3 header in L2 header which includes {SRC MAC host A, DST MAC R1)
- now R1 has the packet, now DST will be host B. this destination exist on R1 routing table.
- R1 has L3 header and create L2 header to find the DST (host B MAC)
- R1 host A and DST host B IP adress.
- SRC: R1 int MAC = L3 header
- DST: host B MAC = L2 header
- L3 header is not changed which created by hostA.
No comments:
Post a Comment