Notes

Networks

OSI Layers

OSI Layer Data trace

Traditional RPC

RPC

GRPC

GRPC

Layers

L1

Bits & Bytes 1 byte = 8 bits

alt text Ethernet (IEEE 802.3) Types of Ethernet Connectors:

  1. RJ45(Registered Jack 45)(port type) - Copper cable (UTP - Unshielded Twisted Pair)

  2. SFP (Small Form-factor Pluggable)(port type) - Fiber Optic - Glass cable

L2

MAC Address (Media Access Control)

Switches operate at Layer 2 (Data Link Layer) and use MAC addresses to forward data frames within a local area network (LAN).

Address Resolution Protocol (ARP) is used to map IP addresses to MAC addresses within a local network.

L3

IP Address (Internet Protocol Address)

/32 is the subnet mask for a single host, meaning that all 32 bits are used for the host portion of the IP address. x.x.x.0 will be gateway address for the network, and x.x.x.255 will be broadcast address for the network. /30 is the subnet mask for a point-to-point link, meaning that 30 bits are used for the network portion and 2 bits are used for the host portion, allowing for 2 usable IP addresses on the link.

Routers operate at Layer 3 (Network Layer) and use IP addresses to forward data packets between different networks.

IPv4 Header

alt text

IP Subnetting

IP subnetting is the process of dividing a larger network into smaller, more manageable sub-networks, or subnets. This allows for better utilization of IP addresses and improved network performance and security.

Classful Subnetting alt text

Classless Inter-Domain Routing (CIDR) alt text

CIDR notation is a method for allocating IP addresses and routing IP packets. It replaces the older system based on classes A, B, and C. CIDR allows for more efficient use of IP addresses by enabling variable-length subnet masking (VLSM).

VLSM (Variable Length Subnet Masking) VLSM allows network administrators to divide an IP address space into subnets of different sizes, optimizing the allocation of IP addresses based on the specific needs of each subnet. This flexibility helps conserve IP addresses and improve network efficiency.

Steps to calculate subnets using VLSM:

  1. Determine the total number of required subnets and hosts per subnet.
  2. Assign the largest subnet at the start of the address space.
  3. Assign the second largest subnet next, and so on, until all subnets are allocated.

VLANs

Broadcast Domain

A broadcast domain is the group of devices on a network segment that can receive broadcast frames(destination MAC FF:FF:FF:FF:FF:FF) from each other. Broadcast frames are sent to all devices within the same broadcast domain, and they are typically used for network discovery and communication.

A router separates broadcast domains, meaning that devices on different broadcast domains cannot directly communicate with each other using broadcast frames. This helps to reduce network congestion and improve performance by limiting the scope of broadcast traffic.

LAN A LAN is a single broadcast domain, including all devices connected to the same switch or set of interconnected switches.


VLANs VLANs (Virtual Local Area Networks) allow network administrators to segment a physical network into multiple logical networks at Layer 2. This can improve security and reduce broadcast traffic by isolating different groups of devices within the same physical infrastructure.

VLANs are configured on switches and are identified by a VLAN ID (VID). Devices within the same VLAN can communicate with each other as if they were on the same physical network, even if they are connected to different switches.

Switches do not forward traffic directly between hosts on different VLANs. (To enable communication between VLANs, a router or a Layer 3 switch is required to route traffic between the VLANs.)

VLAN Tagging

Trunk Port = Tagged Port Access Port = Untagged Port

VLAN tagging is a method used to identify which VLAN a particular Ethernet frame belongs to when it is transmitted over a trunk link. This is essential for allowing multiple VLANs to share the same physical network infrastructure while maintaining logical separation between them.

alt text

Native VLAN: The default VLAN on a switch port, which is used for untagged traffic. By default, the native VLAN is VLAN 1, but it can be changed to any other VLAN as needed.

ROAS (Router on a Stick): A network configuration where a single physical router interface is used to route traffic between multiple VLANs. This is achieved by configuring sub-interfaces on the router, each associated with a different VLAN and using 802.1Q tagging to differentiate the traffic. Eg: If a router has a single physical interface (e.g., GigabitEthernet0/0), it can be configured with sub-interfaces like GigabitEthernet0/0.10 for VLAN 10, GigabitEthernet0/0.20 for VLAN 20, and so on. Each sub-interface is assigned an IP address corresponding to its VLAN, allowing the router to route traffic between the VLANs.