Network Devices: Basics
Network devices make us to connect over other devices and internet. They follow and work over protocols defined in OSI models. Each level of OSI model has its own set of devices which work on it and follows its protocol to share the data. Each layer directly communicates with the layer above and below it.
These devices can be physical as well as logical.
HUB / Repeaters: these devices work on the Physical layer of OSI model. The data flows in form of electric signals in hubs and when weekends a repeater does boost the signal.
Switches: These devices work at the 2nd layer of OSI model: Datalink layer. They are used to have the track of Mac address of each device. MAC address is unique for each device. The switch Unicasts a FRAME to each device in network and maps it to port the device is connected to. It maintains a content addressable memory (mac address table) to record each devices mac address and the port it is connected at switch.
Routers: These devices function at network layer and read the source and destination IP address of the frame and add new destination to the frame while considering the routing table, if required.
Firewalls: These device work on the layer Transport layer of the OSI model. These are one of the first devices which were used as a software as well as a utility to allow or deny inbound / outbound traffic. These check the UDP and TCP headers and apply policies before forwarding these packets. Web Application Firewalls are used to filter the URLs for SQL injections. WAFs are used at layer 7. Firewalls mostly do port-based filtering while the WAFs are used for protocol-specific filtering.
Load Balancers: These devices can work on layer 7 and layer 4 as well. These devices are used to distribute traffic equally between the servers. To do so it uses some techniques like round robin or least connections. To move the data to server it puts NAT address of the server on the data and sends it. Layer 7 load balancers are software based; they are used to load balance JSON/XML content, decrypt TLS/SSL and parse HTTP/HTTPs headers.