Networking Fundamentals: Switches, Routing, DNS, and Security
How Switches Work: Learning, Flooding, Filtering, Forwarding, and Aging
Switches operate similarly to hubs, but with the added capability of identifying the intended destination of received information. This allows them to send data only to the computers that are supposed to receive it. The key functions are:
- Learning: The switch reads the MAC address and saves it to a lookup table. This allows the switch to know where to find the node (Source MAC, segment, port, timestamp).
- Flooding: The switch sends the packet to all segments except the one from which it arrived. The correct node then sends an acknowledgment to the source node.
- Filtering: Once the lookup table is complete, the switch can find the MAC address in the table.
- Forwarding: The source node consults the MAC address of the target node in the switch table and then sends the packet directly.
- Aging: The switch has a user-configurable timer that erases an entry after a certain period of inactivity from that node. This frees up memory resources.
Static and Dynamic Routing
Static Routing:
A static routing table is created, maintained, and updated manually by a network administrator. A static route to every network must be configured on every router for full connectivity. Routers do *not* share static routes with each other, reducing CPU/RAM overhead and saving bandwidth. However, static routing is *not* fault-tolerant; any change to the routing infrastructure requires manual intervention.
Dynamic Routing:
A dynamic routing table is created, maintained, and updated by a routing protocol running on the router (e.g., RIP – Routing Information Protocol). Routers *do* share dynamic routing information, which increases CPU, RAM, and bandwidth usage.
How DNS Name Resolution Works
- A network host is configured with an initial cache (hints) of the known addresses of the root name servers. This hint file is updated periodically by an administrator from a reliable source.
- A query is sent to one of the root servers to find the server authoritative for the top-level domain.
- A query is sent to the obtained TLD (top-level domain) server for the address of a DNS server authoritative for the second-level domain.
- The previous step is repeated to process each domain name label in sequence, until the final step, which returns the IP address of the desired host.
Advantages and Disadvantages of Infrared and Radio Frequency
Infrared (Advantages):
- Requires low voltage.
- Low-cost circuitry.
- Simple circuitry: No special hardware is required; it can be incorporated into an integrated circuit.
- High security: Devices are directly aligned to communicate.
Infrared (Disadvantages):
- Blocked by common materials: people, walls, plants, etc.
- Short range.
- Sensitive to light and weather. Direct sunlight, for example, can affect transmission.
- Speed: Data transmission is slower than typical cable transmission.
CSMA/CA in Wireless Communication
CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) is also called RTS/CTS (Request to Send/Clear to Send) because of the way hosts must communicate. The process is as follows:
The transmitter sends a short Request to Send (RTS) packet containing the source and destination network addresses, and the duration of the transmission. If the medium is available, the destination responds with a Clear to Send (CTS) packet. All devices on the network recognize this. If the source doesn’t receive an acknowledgment, it retransmits RTS packets until access is granted.
Comparison of 802.11 (a, b, and g) Standards
- 802.11a: Maximum data rate of 54 Mbps, 12 non-overlapping frequency channels, operates in the 5 GHz band (UNI band). Signals are more readily absorbed by walls. Not typically used in homes.
- 802.11b: Maximum data rate of 11 Mbps, 3 non-overlapping frequency channels (1-6-11), operates in the 2.4 GHz band (ISM band). Suffers interference from other products in the 2.4 GHz band. Used in homes.
- 802.11g: Maximum data rate of 54 Mbps, 3 non-overlapping frequency channels (1-6-11), operates in the 2.4 GHz band (ISM band), backward compatible with 802.11b. Suffers interference from other products in the 2.4 GHz band. Used in homes.
Wireless Network Modes: Ad-hoc vs. Infrastructure
Ad-hoc Mode:
Also known as peer-to-peer mode, where each wireless node is in direct contact with every other node in a decentralized manner. Suitable for small groups.
Infrastructure Mode:
Wireless networks in infrastructure mode use one or more WAPs (Wireless Access Points) to connect to a wired network segment. A single WAP servicing an area is called a Basic Service Set (BSS). Infrastructure mode offers scalability, centralized security management, and improved reach. The disadvantage is the added cost of AP hardware.
Configuring a WAP as an Extension Point
- Connect the computer to one of the four LAN ports on the router.
- Open a web browser, type “192.168.2.1” in the address bar, and press Enter.
- Click Login in the upper right corner.
- The router does not ship with a password, so just click Submit.
- Click Use as Access Point on the left side of the page.
- Select Enable. This will allow you to set the IP Address and Subnet mask for the router. These settings should match your existing network. By default, the IP address is set to 192.168.2.254 and the Subnet mask is 255.255.255.0.
Wireless Security Authentication: PSK vs. RADIUS
WPA-PSK (Pre-Shared Key): An authentication mechanism where users provide credentials to verify access. Requires a single password entered into each WLAN device.
RADIUS (Remote Authentication Dial-In User Service): A client/server protocol (application layer) using UDP for transport. RADIUS servers use the AAA (Authentication, Authorization, and Accounting) concept to manage network access. Individual keys are automatically configured.
Caesar Cipher Encryption
A Caesar cipher is a simple encryption technique. It’s a substitution cipher where each letter in the plaintext is replaced by a letter corresponding to a number in the alphabet (A=1, B=2, etc.). A key is used to shift the letters. To encrypt “SECRET” with a key of 10:
S (19) + 10 = 29 -> 29 – 26 = 3 -> C
E (5) + 10 = 15 -> O
C (3) + 10 = 13 -> M
R (18) + 10 = 28 -> 28 – 26 = 2 -> B
E (5) + 10 = 15 -> O
T (20) + 10 = 30 -> 30 – 26 = 4 -> D
The encrypted text is “COMBOD”.
Symmetric-Key vs. Asymmetric-Key Systems
Symmetric Encryption: Requires both sides of an encrypted conversation to use the *same* encryption key to encode and decode data.
Asymmetric-Key Encryption: Uses a *pair* of keys: a public key sent with the message and a private key held by the recipient. The private key is derived from the public key, and only the two keys working together can decrypt the packets.
Comparison of Symmetric and Asymmetric Encryption
Security: Asymmetric-key encryption is more secure because the private key is never sent. Symmetric-key encryption is less secure because the key must be transmitted.
Speed: Symmetric encryption is faster due to simpler operations. Asymmetric encryption is slower due to complex mathematical operations.
Number of Keys: For *N* people:
- Symmetric-key: N*(N-1)/2 keys are needed.
- Asymmetric-key: 2*N keys are needed.
SSL and Encryption
SSL (Secure Sockets Layer) uses *both* symmetric and asymmetric encryption.
- Symmetric algorithms: Use the same key for encryption and decryption. Faster but less secure if the key is compromised.
- Asymmetric algorithms: Use a pair of keys (public and private). More secure but slower.
SSL uses asymmetric encryption to securely exchange a randomly selected symmetric key. Then, the faster symmetric key is used for the bulk of the communication. The process (with server authentication) is:
- Client requests a secure page (HTTPS).
- Server sends its public key and certificate.
- Client verifies the certificate (issued by a trusted party, validity, and relation to the site).
- Client encrypts a random symmetric key with the server’s public key and sends it, along with encrypted data.
- Server decrypts the symmetric key using its private key and uses it to decrypt the data.
- Server sends back the requested data, encrypted with the symmetric key.
- Client decrypts the data using the symmetric key.