Dark Mode
Image
  • Friday, 13 December 2024
Computer Network-4: Network Layer

Computer Network-4: Network Layer

 


Computer Network-4: Network Layer - Outline
  1. Summary
  2. Terminologies
  3. Network Devices
  4. TCP Vs IP
  5. Network Layer
  6. Datagrams
  7. Router
  8. DHCP: Dynamic Host Configuration Protocol
  9. NAT: network address translation
  10. ICMP
  11. RIP (Routing Information Protocol)
  12. Router Command
  13. Questions
  14. References

Summary

Network Address Translation (NAT) is the process of mapping an internet protocol (IP) address to another by changing the header of IP packets while in transit via a router.

TCP: Connection Oriented/Reliable/Guarantee Delivered/Not Real time/Acknowledgement/In order delivery

Routing is the process of moving data from one device to another device based on Forwarding Table.

Static Routing: all the routes are added manually and won't change unless one intends to modify them.

Dynamic Routing: is exchange routing information with other routers and automatically adjust the routing table based on network changes.

Forwarding is simply defined as the action applied by each router when a packet arrives at one of its interfaces based on forwarding table.

Datagram is a basic transfer unit associated with a packet-switched network. It is an enclosed, complete communication that is sent through a network, and its arrival, timing, and content are not assured.

Router is a networking device that forwards data packets between computer networks.

Router Architecture: Input Port: line termination, link layer protocol(receive), lookup forwarding Queueing / Switching Fabrics: Switching via Memory, bus, crossbar / Output Port: datagram buffer queueing, link layer protocol(send), line termination / Routing Processor

Routing table is a set of rules, often viewed in table format, that's used to determine where data packets traveling over an Internet Protocol (IP) network will be directed.

Entries Routing Table: Network ID/Subnet Mask/Next Hop/Outgoing Interface/Metric

DHCP is an application layer protocol that automatically assign IP addresses and other network configuration parameters to devices.

Components DHCP: Server/Client/IP address pool/Subnet/Lease/DHCP relay

DHCP client-server scenario: Client Initialization/DHCP Discover/DHCP Offer/DHCP Request/ACK

NAT is the network process that is the task of translating and assigning the private network model, to the global IP address to access internet services.

Internet Control Message Protocol (ICMP) is used for reporting errors and performing network diagnostics. In the error reporting process, ICMP sends messages from the receiver to the sender when data is not received.

Routing Information Protocol (RIP)is a distance-vector routing protocol that uses hop count as a routing metric to find the best path between the source and the destination network.

Terminologies

Network:A network is a collection of computers and devices that are connected together to enable communication and data exchange.

Nodes:Nodes are devices that are connected to a network. These can include computers, Servers, Printers,Routers,Switches, and other devices.

Protocol:A protocol is a set of rules and standards that govern how data is transmitted over a network. Examples of protocols includeTCP/IP,HTTP, andFTP.

NAT: A Network Address Translation (NAT) is the process of mapping an internet protocol (IP) address to another by changing the header of IP packets while in transit via a router.

IP Address: An IP address is a unique numerical identifier that is assigned to every device on a network. IP addresses are used to identify devices and enable communication between them.

DNS:TheDomain Name System (DNS)is a protocol that is used to translate human-readable domain names (such as www.google.com) into IP addresses that computers can understand.

Firewall:Afirewallis a security device that is used to monitor and control incoming and outgoing network traffic. Firewalls are used to protect networks from unauthorized access and other security threats.

Network Devices

Switches may operate at one or more layers of the OSI model. They may operate in the data link layer and network layer; a device that operates simultaneously at more than one of these layers is known as amultilayer switch.

Router is a networking device that forwards data packets between computer networks. Routers are small physical devices that operate at the network layer to join multiple networks together.

  • A router is a device like a switch that routes data packets based on their IP addresses.
  • Routers normally connect LANs and WANs and have a dynamically updating routing table based on which they make decisions on routing the data packets.
  • A Router divides the broadcast domains of hosts connected through it.

Gateway:A network gateway can operate at any level of the OSI model. A broadband router typically serves as the network gateway, although ordinary computers can also be configured to perform equivalent functions.

  • A gateway is a router or proxy server that routes between networks.
  • A gateway belongs to the same subnet to which the PC belongs.

Switch Vs Hub?

Feature Switch Hub
Operation Operates at the data link layer (Layer 2) Operates at the physical layer (Layer 1)
Address Learning Using Memory keep MAC addresses and builds a MAC table No Memory, So does not keep MAC addresses
Broadcast Domain Forms separate broadcast domains for each port Broadcasts data to all ports, creating a single broadcast domain
Collision Domain Forms separate collision domains for each port Shares a single collision domain among all ports
Bandwidth Allocation Provides dedicated bandwidth for each port Shares bandwidth among all connected devices
Efficiency More efficient due to reduced collisions Less efficient, as collisions can occur more frequently
Network Performance Better performance in terms of speed and reliability Performance may degrade in larger networks due to collisions
Cost Typically, more expensive Generally, less expensive
Scalability More scalable for larger networks Less scalable, as network size increases, performance may decrease
Security Provides better security through VLAN support Limited security features, all devices in the same broadcast domain

TCP Vs IP

TCP/IP is to transfer the data of a computer from one device to another. The main condition of this process is to make data reliable and accurate so that the receiver will receive the same information which is sent by the sender. To ensure that, each message reaches its final destination accurately, the TCP/IP model divides its data into packets and combines them at the other end, which helps in maintaining the accuracy of the data while transferring from one end to another end.

The Transmission Control Protocol (TCP) is a communication protocol responsible for ensuring that data is transferred reliably and in order between the two devices.

IP is the network layer protocol responsible for routing network traffic.

IP finds the destination of the mail and TCP has the work to send and receive the mail. UDP is another protocol, which does not require IP to communicate with another computer. IP is required by only TCP.

TCP/IP Callback Life Cycle

The TCP/IP protocol suite is the set of communication protocols used to connect hosts on the Internet. TCP/IP allows computers on the same network to identify and communicate with each other. TCP/IP is a two-layer protocol, with the transport layer (TCP) responsible for reliable end-to-end communication and the Internet layer (IP) accountable for routing packets from the host to the host. TCP/IP is a set of standardized rules that allow computers to communicate on a network such as the internet.

  • At the transport layer, TCP provides a reliable byte-stream service to applications. TCP guarantees the delivery of data and that data will be delivered in the same order in which it was sent. TCP uses several mechanisms to provide this service, including sequence numbers, acknowledgments, and timeouts.
  • At the Internet layer, IP is responsible for routing datagrams (packets) from host to host. IP does not guarantee the delivery of datagrams, but it tries to deliver them as best. If a datagram cannot be delivered, IP will return an error message to the source host.

Advantages of TCP/IP

  • Scalability: The TCP/IP model is highly scalable and can accommodate small and large networks.
  • Reliability: The model is robust and reliable, making it suitable for mission-critical applications.
  • Flexibility: It is very flexible, allowing for interoperability between different types of networks.
  • Security: The various protocols in the model provide robust security measures.
  • Cost-effectiveness: TCP/IP is relatively inexpensive to implement and maintain.

Disadvantages of TCP/IP

  • Complexity: The model is quite complex and requires a certain degree of expertise to configure and maintain.
  • Vulnerability: Because of its complexity, it is vulnerable to attack.
  • Performance: Performance can be degraded due to network congestion and latency.

Uses of TCP/IP

Here are some of the most valuable uses of TCP/IP models:

  • World Wide Web: TCP/IP transfers data between web browsers and servers.
  • Email: Applications such as Outlook, Thunderbird, and Gmail use TCP/IP protocols to send and receive emails.
  • File Transfer: FTP, SFTP, and other file transfer services rely on TCP/IP to move files from one computer to another.
  • Networking: TCP/IP links computers together in a network.
  • Virtual Private Networks: VPNs use TCP/IP to encrypt data before it travels across a public or private network.
  • Internet of Things: Many smart home devices use TCP/IP to communicate and transfer data.
  • Voice Over Internet Protocol: VOIP services such as Skype and Google Voice use TCP/IP to transmit calls over the internet.

TCP Vs UDP

Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) both are protocols of the Transport Layer. TCP is a connection-oriented protocol where as UDP is a part of the Internet Protocol suite, referred to as the UDP/IP suite. Unlike TCP, it is an unreliable and connectionless protocol.

Lightbox

TCP UDP
Connection Oriented Connection less
Reliable Non-Reliable
Guarantee Delivered Non-Guarantee
Not Real time Suitable for Real Time
Acknowledgement Not Acknowledgement
In order delivery Unorder delivery

Network Layer

TCP_Model_5

The Network layer performs the task of controlling the transmission of the data over the network modes and enacts protocols related to the various steps related to the transmission of data over the channel, which is in the form of packets sent by the previous layer.

Goal

  • Transport segment from sending to receiving host.
  • On sending side encapsulates segments into datagrams
  • On the receiving side, delivers segments to transport layer.
  • Network layer protocols in every host, router
  • Router examines header fields in all IP datagrams passing through it.

Protocol

  • Internet Protocol (IP): IPv4, IPv6: are the primary protocols for addressing and routing packets across networks.
  • Internet Control Message Protocol (ICMP): Used for error reporting and diagnostics, often associated with tools like ping.
  • Internet Group Management Protocol (IGMP): Used by hosts and adjacent routers to manage multicast group memberships.
  • Routing Information Protocol (RIP): A distance-vector routing protocol used for routing within an autonomous system.
  • Intermediate System to Intermediate System (IS-IS): Another link-state routing protocol often used in large, complex networks.
  • Border Gateway Protocol (BGP): A path vector protocol used for inter-domain routing on the Internet.
  • Internet Protocol Security (IPsec): A suite of protocols that provide security at the Network layer, including authentication and encryption.

What happen in Network Layer?

  • Transport segment from sending to receiving host
  • On sending side, encapsulates segments into datagrams
  • On receiving side, delivers segments to transport layer
  • Network layer protocols in every host, router
  • Router examines header fields in all IP datagrams passing through it

Features

The main responsibility of the Network layer is as following-

  • To carry the data packets from the source to the destination without changing or using them.
  • If the packets are too large for delivery, they are fragmented i.e., broken down into smaller packets.
  • It decides the route to be taken by the packets to travel from the source to the destination among the multiple routes available in a network (also called routing).
  • The source and destination addresses are added to the data packets inside the network layer.

Functions

The services which are offered by the network layer protocol are as follows:

  1. Packetizing: The process of encapsulating the data received from the upper layers payload of the network packet at the source and decapsulating the payload from the network layer packet at the destination is known as packetizing.
  2. Routing: Routing is the process of moving data from source device to destination device.
  3. Forwarding: The action applied by each router when a packet arrives at one of its interfaces. move packets from router's input to appropriate router output.

Routing Vs Forwarding

Routing Forwarding
Routing is the process of moving data from one device to another device. Forwarding is simply defined as the action applied by each router when a packet arrives at one of its interfaces.
Work is based on Forwarding Table. Checks the forwarding table and work according to that.
Works on protocols like Routing Information Protocol (RIP) for Routing. Works on protocols like UDP Encapsulating Security Payloads

Datagrams

A datagram is a basic transfer unit associated with a packet-switched network. It is an enclosed, complete communication that is sent through a network, and its arrival, timing, and content are not assured.

Datagram networks, such as those using the User Datagram Protocol (UDP), allow for connectionless communication where data is transmitted via individual datagrams.

  • No call setup at network layer
  • Routers: no state about end-to-end connections
  • No network-level concept of "connection"
  • Packets forwarded using destination host address

IP Datagram

  • Formally, an IP packet is called an IP datagram.
  • An IP datagram consists of a header followed by a data area.
  • The data area is often referred to as the payload.
  • The payload can be as small as one octet (an octet is 8 bits).
  • In IPv4, the combined size of the header and payload is allowed to be as large as 64K octets (but no larger).
  • In IPv6, the payload itself is allowed to be up to 64K octets.

Figure: The general form of an IP datagram with a header followed by a payload.

IPv4 datagram format

VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4

HLEN: IP header length (4 bits), which is the number of 32 bit words in the header. The minimum value for this field is 5 and the maximum is 15.

Type of service: Low Delay, High Throughput, Reliability (8 bits)

Total Length: Length of header + Data (16 bits), which has a minimum value 20 bytes and the maximum is 65,535 bytes.

Identification: Unique Packet Id for identifying the group of fragments of a single IP datagram (16 bits)

Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment flag, more fragments flag (same order)

Fragment Offset: Represents the number of Data Bytes ahead of the particular fragment in the particular Datagram. Specified in terms of number of 8 bytes, which has the maximum value of 65,528 bytes.

Time to live: Datagrams lifetime (8 bits), It prevents the datagram to loop through the network by restricting the number of Hops taken by a Packet before delivering to the Destination.

Protocol: Name of the protocol to which the data is to be passed (8 bits)

Header Checksum: 16 bits header checksum for checking errors in the datagram header

Source IP address: 32 bits IP address of the sender

Destination IP address: 32 bits IP address of the receiver

Option: Optional information such as source route, record route. Used by the Network administrator to check whether a path is working or not.

Forwarding an IP Datagram

A datagram forwarding table is a route database within a router that is used to choose the address and relevant interface of the next-hop router or destination host. It is also called a routing table or forwarding table. Switches also have forwarding tables that indicate the neighboring switch to which it should forward a datagram addressed to a given destination. Switches utilize forwarding tables to decide where to send the received frames.

  • If an IP datagram is not addressed to a local destination, it is forwarded from router to router until it reaches a router connected to the destination network. That router forwards the packet to its final destination.
  • The Internet uses next-hop forwarding.
  • Routers decide on the next hop based on the network prefix of the destination address.

Figure: (a) An example IPv4 internet with four networks (b) The forwarding table found in router R2

Question: What service model for "channel" transporting datagrams from sender to receiver?

Services for individual datagrams:

  • Guaranteed delivery
  • Guaranteed delivery with less than 40 msec delay

services for a flow of datagrams:

  • In-order datagram delivery
  • Guaranteed minimum bandwidth to flow
  • Restrictions on changes in inter-packet spacing

Router

Definition

A Router is a networking device that forwards data packets between computer networks. Routers are small physical devices that operate at the network layer to join multiple networks together.

  • A router is a device like a switch that routes data packets based on their IP addresses.
  • Routers normally connect LANs and WANs and have a dynamically updating routing table based on which they make decisions on routing the data packets.
  • A Router divides the broadcast domains of hosts connected through it.

Network_devices

Architecture

Given below is a diagram which explains the architecture of router:

A diagram of a computer process  Description automatically generated

Input Port

This is the interface by which packets are admitted into the router, it performs several key functions as-

  • Leftmost Part: Terminating the physical link at the router,
  • Middle part does the work of interoperating with the link-layer like decapsulation,
  • Last part of the input port the forwarding table is looked up and is used to determine the appropriate output port based on the destination address.

Switching Fabrics

It is the combination of hardware and software which moves data coming into a network node out by the correct port to the next node in the network.

  • Transfer packet from input buffer to appropriate output buffer.
  • Switching rate: rate at which packets can be transferred from inputs to outputs.

There are three types of switching fabrics-

  1. Switching via Memory: Traditional computers with switching under direct control of CPU where packet copied to system memory. Here, speed is limited by memory bandwidth.
  2. Switching via a bus: Datagram from input port memory to output port memory via a shared bus where switching speed limited by bus bandwidth.

Switching via interconnection network: A crossbar switch is an interconnection network that connects N input ports to N output ports using 2N buses. Horizontal buses meet the vertical buses at crosspoints which are controlled by the switching fabric.

Output Port

This is the segment from which packets are transmitted out of the router. The output port looks at its queuing buffers and takes packets, does link layer functions, and finally transmits the packets to an outgoing link.

Routing Processor

It executes the routing protocols, and it works like a traditional CPU. It employs various routing algorithms like the link-state algorithm, distance-vector algorithm, etc. to prepare the forwarding table, which is looked up to determine the route and the output port.

Router Table

A routing table is a set of rules, often viewed in table format, that's used to determine where data packets traveling over an Internet Protocol (IP) network will be directed.

A network consisting of two PCs and a Router A screenshot of a computer  Description automatically generated


A routing table contains the information necessary to forward a packet along the best path toward its destination. Each packet contains information about its origin and destination. Routing Table provides the device with instructions for sending the packet to the next hop on its route across the network.

Each entry in the routing table consists of the following entries:

  1. Network ID: The network ID or destination corresponding to the route.
  2. Subnet Mask: The mask that is used to match a destination IP address to the network ID.
  3. Next Hop: The IP address to which the packet is forwarded.
  4. Outgoing Interface: Outgoing interface the packet should go out to reach the destination network.
  5. Metric: A common use of the metric is to indicate theminimum number of hops(routers crossed) to the network ID.

How are Routing Tables populated?

There are ways to maintain Routing Table:

  • Default Routing: Directly connected networks are added automatically. Default routing is a method of configuring a router to forward packets to a single destination when there is no specific route for the destination in the routing table.
  • Static Routing: all the routes are added manually and won't change unless one intends to modify them.
  • Dynamic Routing: routes are learned or updated by routing protocols. Routing protocols exchange routing information with other routers and automatically adjust the routing table based on network changes.

Static Vs Dynamic Routing

Key Static Routing Dynamic Routing
Routing pattern In static routing, user-defined routes are used in the routing table. In dynamic routing, routes are updated as per the changes in network.
Routing Algorithm No complex algorithm used to figure out the shortest path. Dynamic routing employs complex algorithms to find the shortest routes.
Security Higher security. Less secure.
Automation Manual process. Automatic process.
Applicability Smaller networks. Large networks.
Protocols Not follow any specific protocol. Follows protocols like BGP, RIP and EIGRP.
Additional Resources Not require any additional resources. Requires additional resources like memory, bandwidth etc.

3 basics for Networking

  1. Networking Address: Network addressing is a fundamental system that assigns unique identifiers to each device on a network.
  2. Broadcast Address: A broadcast address is a network address used to transmit to all devices connected to a multiple-access communications network. A message sent to a broadcast address may be received by all network-attached hosts.
  3. Subnet Mask: A subnet mask is a four-octet number used to identify the network ID portion of a 32-bit IP address. A subnet mask is required on all class-based networks, even on networks that are not subnetted.

A close-up of a computer  Description automatically generated

DHCP: Dynamic Host Configuration Protocol

Dynamic Host Configuration Protocol is an application layer protocol that automatically assign IP addresses and other network configuration parameters to devices (such as computers, smartphones, and printers) on a network.

Goal

The primary goal of DHCP (Dynamic Host Configuration Protocol) is to automate the assignment of IP addresses, subnet masks, default gateways, and other network configuration parameters to devices on a network.

  • DHCP eliminates the need for manual configuration of each device, making network administration more efficient.
  • It supports the reuse of IP addresses, optimizing address allocation within the network.
  • It support for mobile users who want to join network

Components

Following are the list of components:

DHCP Server: DHCP server is a networked device running the DCHP service that holds IP addresses and related configuration information.

DHCP client: DHCP client is the endpoint that receives configuration information from a DHCP server. This can be any device like computer, laptop, IoT endpoint

IP address pool: IP address pool is the range of addresses that are available to DHCP clients. IP addresses are typically handed out sequentially from lowest to the highest.

Subnet: Subnet is the partitioned segments of the IP networks. Subnet is used to keep networks manageable.

Lease: Lease is the length of time for which a DHCP client holds the IP address information. When a lease expires, the client has to renew it.

DHCP relay: A host or router that listens for client messages being broadcast on that network and then forwards them to a configured server. The server then sends responses back to the relay agent that passes them along to the client. DHCP relay can be used to centralize DHCP servers instead of having a server on each subnet.

DHCP client-server scenario

A diagram of a network  Description automatically generated

In a DHCP client-server scenario:

Client Initialization: When a device, such as a computer or smartphone, connects to a network, it initially lacks an IP address and other network configuration parameters.

DHCP Discover: The client broadcasts a DHCP Discover message to locate a DHCP server within the network.

DHCP Offer: DHCP servers within the network respond with a DHCP Offer message, offering an IP address and other network configuration parameters to the client.

DHCP Request: The client selects one of the DHCP server's offers and sends a DHCP Request message to confirm the lease of the offered IP address.

DHCP Acknowledgment: The DHCP server responds with a DHCP Acknowledgment message, confirming the lease of the IP address and providing additional network configuration parameters.

Advantages

    • Centralized management of IP addresses.
    • Centralized and automated TCP/IP configuration.
    • Ease of adding new clients to a network.
    • Reuse of IP addresses reduces the total number of IP addresses that are required.

Disadvantages

  • IP conflict can occur.
  • The client is not able to access the network in absence of a DHCP Server.
  • The name of the machine will not be changed in a case when a new IP Address is assigned.

NAT: network address translation

Network Address Translation (NAT) is the network process that is the task of translating and assigning the private network model, to the global IP address to access internet services.

Network Address Translation (NAT) is a process that enables one, unique IP address to represent an entire group of computers. In network address translation, a network device, (often a router or NAT firewall), assigns a computer inside a private network a public address. In this way, network address translation allows the single device to act as an intermediary or agent between the local, private network and the public network (like internet).

This image depicts network address translation (NAT) and the process of syncing all device addresses to a secure server.

Motivation

Local network uses just one IP address as far as outside world is concerned:

  • range of addresses not needed from ISP: just one IP address for all devices
  • can change addresses of devices in local network without notifying outside world
  • can change ISP without changing addresses of devices in local network
  • devices inside local net not explicitly addressable, visible by outside world (a security plus)

Types

Network_address_translation_Static_NAT.

Static NAT- In this NAT process, one single private network is mapped to an individual public IP address. This process of translation is also known as one-to-one NAT, used generally for private network connections.

Network_address_translation_Dynamic_NAT.

Dynamic NAT- For this NAT translation process, the private network address is converted to a public IP address by choosing it from a pool of public IP addresses available to the network model.

Network_address_translation_port_address_translation.

Port Address Translation- This translation process is configured to convert all the private IP addresses available to a single public IP address, but with a different port number assigned to each of the public addresses.



Inside refers to the addresses which must be translated. Outside refers to the addresses which are not in control of an organization. These are the network Addresses in which the translation of the addresses will be done.

A black background with arrows  Description automatically generated

Inside local address -An IP address that is assigned to a host on the Inside (local) network. The address is probably not an IP address assigned by the service provider i.e., these are private IP addresses. This is the inside host seen from the inside network.

Inside global address -IP address that represents one or more inside local IP addresses to the outside world. This is the inside host as seen from the outside network.

Outside local address -This is the actual IP address of the destination host in the local network after translation.

Outside global address -This is the outside host as seen from the outside network. It is the IP address of the outside destination host before translation.

NAT Implementation

The router that connects the network to the global address uses one private address and one global address.The private network is transparent to the rest of the Internet; the rest of the Internet sees only the NAT router with the address 200.24.5.8.

Address translation

All the outgoing packets go through the NAT router, which replaces the source address in the packet with the global NAT address.All incoming packets also pass through the NAT router, which replaces the destination addresses in the packet with the appropriate private address.

Translation Table

  • When the router translates the source address of the outgoing packet, it also makes note of the destination address - where the packet is going.
  • When the response comes back from the destination, the router uses the source address of the packet to find the private address of the packet.

Table: Five-column translation table

Advantages

  • NAT conserves legally registered IP addresses.
  • It provides privacy as the device’s IP address, sending and receiving the traffic, will be hidden.
  • Eliminates address renumbering when a network evolves.

Disadvantage

  • Translation results in switching path delays.
  • Certain applications will not function while NAT is enabled.
  • Complicates tunneling protocols such as IPsec.

ICMP

Internet Control Message Protocol (ICMP) is used for reporting errors and performing network diagnostics. In the error reporting process, ICMP sends messages from the receiver to the sender when data is not received.

RIP (Routing Information Protocol)

Routing Information Protocol (RIP) is a distance-vector routing protocol that uses hop count as a routing metric to find the best path between the source and the destination network.

Features of RIP

  1. Updates of the network are exchanged periodically.
  2. Updates (routing information) are always broadcast.
  3. Full routing tables are sent in updates.
  4. Routers always trust routing information received from neighbor routers. This is also known as Routing on rumors.

Configuration

Consider the above-given topology which has 3-routers R1, R2, R3. R1 has IP address 172.16.10.6/30 on s0/0/1, 192.168.20.1/24 on fa0/0. R2 has IP address 172.16.10.2/30 on s0/0/0, 192.168.10.1/24 on fa0/0. R3 has IP address 172.16.10.5/30 on s0/1, 172.16.10.1/30 on s0/0, 10.10.10.1/24 on fa0/0.

Configure RIP for R1 :

          R1(config)# router rip
          R1(config-router)# network 192.168.20.0
          R1(config-router)# network 172.16.10.4
        

Router Command

Basic Configuration

Switch to Hash or Privileged Executive Mode:

        Router> enable
        Router#
      

See the Running Configuration and Start-up Configurations:

        Router# show running-config
        Router# show startup-config
      

Switch to Fully Administrative or Global Configuration Mode:

        Router# configure terminal
        Router(config)#
      

Change the Hostname:

        Router(config)# Hostname BUP
        BUP(config)#
      

Give Enable Password:

        BUP(config)# enable password mcse
      

Configure the Interfaces (FastEthernet or GigabitEthernet or VLAN):

        BUP(config)# interface fastEthernet 0/0
        BUP(config-if)# ip address 192.168.10.1 255.255.255.0
        BUP(config-if)# no shutdown
        BUP(config-if)# description LAN-BUP
        BUP(config)# interface gigabitEthernet 0/0
        BUP(config-if)# ip address 192.168.11.1 255.255.255.0
        BUP(config-if)# no shutdown
        BUP(config-if)# description LAN-DUET
        BUP(config)# interface serial 0/0/0
        BUP(config-if)# ip address 192.168.10.1 255.255.255.0
        BUP(config-if)# no shutdown
      

Make All the Password Encrypted:

        BUP(config)# service password-encryption
      

Provide the Banner Message:

        BUP(config)# banner motd #Authoized Access
        Only!!#
      

Create Username and Password:

        BUP(config)# username admin password BUP
      

Making back-up of the running configurations:

        BUP# copy running-config startup-config
      

Static Routing Configuration

------------------------ Summary: Static Routing ------------------------------

        BUP(config)#exit
        BUP#show ip route
        BUP#configure terminal
        BUP(config)#ip route 192.168.3.0 255.255.255.0 192.168.1.4
        BUP(config)#exit
        BUP#show ip route
      

------------------------Router-0 Static Routing ------------------------------

        BUP(config)#exit
        BUP#
        %SYS-5-CONFIG_I: Configured from console by console
        BUP#show ip route
        Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
          D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
          N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
          E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
          i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
          * - candidate default, U - per-user static route, o - ODR
          P - periodic downloaded static route
        Gateway of last resort is not set

192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.1.0/24 is directly connected, Serial0/0/0 L 192.168.1.2/32 is directly connected, Serial0/0/0 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.2.0/24 is directly connected, GigabitEthernet0/1 L 192.168.2.1/32 is directly connected, GigabitEthernet0/1

BUP#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. BUP(config)#ip route 192.168.3.0 255.255.255.0 192.168.1.4 BUP(config)#exit BUP# %SYS-5-CONFIG_I: Configured from console by console

BUP#show ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route

        Gateway of last resort is not set

192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.1.0/24 is directly connected, Serial0/0/0 L 192.168.1.2/32 is directly connected, Serial0/0/0 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.2.0/24 is directly connected, GigabitEthernet0/1 L 192.168.2.1/32 is directly connected, GigabitEthernet0/1 S 192.168.3.0/24 [1/0] via 192.168.1.4

------------------------Router-1 Static Routing -------------------------

        DUET(config-if)#exit
        DUET(config)#exit
        DUET#
        %SYS-5-CONFIG_I: Configured from console by console

DUET#show ip route

        Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
          D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
          N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
          E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
          i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
          * - candidate default, U - per-user static route, o - ODR
          P - periodic downloaded static route

        Gateway of last resort is not set
          192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
        C  192.168.1.0/24 is directly connected, Serial0/0/0
        L  192.168.1.4/32 is directly connected, Serial0/0/0
          192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
        C  192.168.3.0/24 is directly connected, GigabitEthernet0/1
        L  192.168.3.1/32 is directly connected, GigabitEthernet0/1

DUET#configure terminal

        Enter configuration commands, one per line. End with CNTL/Z.
        DUET(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.2
        DUET(config)#
        DUET(config)#exit
        DUET#
        %SYS-5-CONFIG_I: Configured from console by console

DUET#show ip route

        Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
          D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
          N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
          E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
          i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
          * - candidate default, U - per-user static route, o - ODR
          P - periodic downloaded static route
        Gateway of last resort is not set

          192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
        C  192.168.1.0/24 is directly connected, Serial0/0/0
        L  192.168.1.4/32 is directly connected, Serial0/0/0
        S 192.168.2.0/24 [1/0] via 192.168.1.2
          192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
        C  192.168.3.0/24 is directly connected, GigabitEthernet0/1
        L  192.168.3.1/32 is directly connected, GigabitEthernet0/1
      

Dynamic Routing Configuration

------------------------Sum

Comment / Reply From