We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35
Routing and Switching
James Jefferson S. De Vera
Routing Concepts What is Routing? What is Routing?
● Routing is the process of selecting paths in a network to
send data from source to destination. ● It's like a GPS for data packets, determining the most efficient routes for information to travel. ● Routers are devices that perform this crucial function in computer networks. Key Concepts in Routing
● Routers: These devices analyze
and forward data packets based on their destination addresses. ● Routing Tables: Routers maintain tables of possible routes and their associated costs or metrics. Key Concepts in Routing
● Routers: These devices analyze
and forward data packets based on their destination addresses. ● Routing Tables: Routers maintain tables of possible routes and their associated costs or metrics. Key Concepts in Routing
● Routers: These devices analyze
and forward data packets based on their destination addresses. ● Routing Tables: Routers maintain tables of possible routes and their associated costs or metrics. Key Concepts in Routing ● Routing Protocols: These are sets of rules routers use to communicate and share information about the network's topology and the best available paths. ● Algorithms: Routing algorithms, such as Dijkstra's algorithm or the Bellman-Ford algorithm or Link-state algorithm, are used to calculate the optimal routes based on various factors like distance, bandwidth, and congestion. Key Concepts in Routing ● Routing Protocols: These are sets of rules routers use to communicate and share information about the network's topology and the best available paths. ● Algorithms: Routing algorithms, such as Dijkstra's algorithm or the Bellman-Ford algorithm or Link-state algorithm, are used to calculate the optimal routes based on various factors like distance, bandwidth, and congestion. Examples of Routing
Home Networks: Your
Wi-Fi router at home uses routing to direct traffic between your devices and the internet. Examples of Routing
Mobile Networks: Cell phone calls
and data use routing to connect your phone to the nearest cell tower and then through the wider mobile network. Examples of Routing
Package Delivery: Logistics
companies use routing algorithms to optimize the delivery of packages to different addresses, minimizing travel time and cost. Primary Functions of a Router Primary Functions of a Router
A router is a networking device
that connects two or more networks together and forwards data packets between them. In the image, the router is the central device, connecting two switches and multiple hubs, which then connect to individual devices. Key functions of a router
Packet Forwarding: This is
the core function of a router. It receives data packets from one network and forwards them to the appropriate next hop based on the destination address and routing table. Key functions of a router
Packet Forwarding: This is
the core function of a router. It receives data packets from one network and forwards them to the appropriate next hop based on the destination address and routing table. Key functions of a router Routing: Routers determine the best path for data packets to travel across networks. They use routing protocols, such as RIP (Routing Information Protocol) or OSPF (Open Shortest Path First), to exchange routing information with other routers and build routing tables. Key functions of a router Network Address Translation (NAT): NAT allows multiple devices on a private network to share a single public IP address. This conserves public IP addresses and enhances security by hiding internal network addresses. Key functions of a router Firewall: Many routers include built-in firewalls that provide basic security features like packet filtering and access control lists (ACLs) to protect networks from unauthorized access. Key functions of a router
Quality of Service (QoS):
QoS enables routers to prioritize specific types of network traffic, such as voice or video, to ensure they receive adequate bandwidth and minimal latency. Key functions of a router
Virtual Private Network
(VPN): Some routers support VPN functionality, allowing secure remote access to private networks over the internet. Encapsulation and De-encapsulation Encapsulation
Encapsulation is the process of adding headers to a data
packet as it moves down the layers of a network model, like the TCP/IP model. Think of it as wrapping a gift: you start with the gift itself (the data), then add layers of wrapping paper (the headers) until it's ready to be sent. Each layer adds a specific type of header, containing information relevant to that layer's function. TCP/IP Model The TCP/IP model is the most common framework for understanding network communication. It consists of four layers: 1. Application Layer: Deals with user-level applications (e.g., email, web browsing). 2. Transport Layer: Ensures reliable data delivery between applications. 3. Network Layer: Responsible for addressing and routing packets across networks. 4. Link Layer: Handles the physical transmission of data on a network. Encapsulation Process
1. Application Layer: Adds a header that identifies the
application protocol being used (e.g., HTTP, SMTP). 2. Transport Layer: Adds a header that provides information for reliable data delivery (e.g., TCP port numbers, sequence numbers). 3. Network Layer: Adds a header that includes source and destination IP addresses for routing. 4. Link Layer: Adds a header that contains source and destination MAC addresses for local network delivery. Example: Sending an Email
1. Application Layer: The email client adds an email header (e.g.,
To, From, Subject). 2. Transport Layer: A TCP header is added to ensure reliable delivery and split the email into segments if necessary. 3. Network Layer: An IP header is added to each TCP segment, specifying the sender's and recipient's IP addresses. 4. Link Layer: An Ethernet header is added to each IP packet, including the sender's and recipient's MAC addresses. De-Encapsulation
De-encapsulation is the reverse process of encapsulation. As
a data packet travels up the layers of the TCP/IP model at the receiving end, each layer removes its corresponding header, revealing the data intended for that specific layer. This allows each layer to process the information relevant to its function. De-Encapsulation Process 1. Data Link Layer: Removes the Ethernet header, which contains source and destination MAC addresses. The remaining data is passed to the Network layer. 2. Network Layer: Removes the IP header, which contains source and destination IP addresses. The remaining data is passed to the Transport layer. 3. Transport Layer: Removes the TCP or UDP header, which provides information about error correction, flow control, and port numbers. The remaining data is passed to the Application layer. 4. Application Layer: Interprets the data according to the specific application protocol (e.g., HTTP for webpages, SMTP for emails) and presents it to the user. Example: Receiving an Email
1. Data Link Layer: The email arrives at your computer's network
interface card (NIC), which removes the Ethernet header. 2. Network Layer: The NIC passes the remaining data to the operating system's network stack, which removes the IP header. 3. Transport Layer: The TCP header is removed, ensuring the email was delivered reliably and in the correct order. 4. Application Layer: Your email client (e.g., Outlook, Gmail) interprets the email data, displaying the message, sender, subject, and other relevant information. Verifying Connectivity Verifying Connectivity Using Ping Command
The ping command is a fundamental network
utility used to test connectivity between two devices. It works by sending small packets of data called "echo requests" to a target device (like a website or another computer). The target device then responds with "echo replies." How Ping Works: 1. Initiating the Ping: You enter the ping command followed by the target device's IP address or domain name (e.g., "ping www.google.com"). 2. Echo Requests: Your device sends out a series of ICMP (Internet Control Message Protocol) echo request packets to the target. 3. Echo Replies: The target device receives these echo requests and sends back ICMP echo reply packets. 4. Measuring Round Trip Time (RTT): The ping command measures the time it takes for each echo request to travel to the target and for the echo reply to return. This time is called the Round Trip Time (RTT) and is usually measured in milliseconds (ms). Ping Output: The ping command output typically shows: 1. Destination: The IP address or domain name of the target device. 2. Packet Size: The size of each echo request packet. 3. Time (TTL): The Time-To-Live value, indicating how many network hops the packet can take before being discarded. 4. Round Trip Time (RTT): The time it took for each echo request/reply round trip. Example: Key Uses of Ping:
problems like connection failures, high latency, or packet loss. •Testing Network Reachability: It confirms whether a particular device or website is online and reachable. •Monitoring Network Performance: Ping can be used to continuously monitor the RTT to a target, providing insights into network stability and speed.