CS3591 COMPUTER NETWORKS
UNIT II FUNDAMENTALS OF NETWORKING
                                                                                    9
Introduction to Networking Concepts - OSI Model Overview - TCP/IP Protocol Suite - Network
Devices and Components - IP Addressing and Subnetting - Routing and Switching Basics -
Wireless networking Fundamentals - Network Security Principles
DATA COMMUNICATION
        Data communications are the exchange of data between two devices via some form of
transmission medium such as a wire cable. For data communications to occur, the communicating
devices must be part of a communication system made up of a combination of hardware (physical
equipment) and software (programs). The effectiveness of a data communications system depends
on four fundamental characteristics: delivery, accuracy, timeliness, and jitter.
1. Delivery. The system must deliver data to the correct destination. Data must be received by the
intended device or user and only by that device or user.
2.Accuracy. The system must deliver the data accurately. Data that have been altered in transmission
and left uncorrected are unusable.
3.Timeliness. The system must deliver data in a timely manner. Data delivered late are useless. In
the case of video and audio, timely delivery means delivering data as they are produced, in the same
order that they are produced, and without significant delay. This kind of delivery is called real-time
transmission.
4. Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in the delivery
of audio or video packets. For example, let us assume that video packets are sent every 30 ms. If
some of the packets arrive with 30-ms delay and others with 40-ms delay, an uneven quality in the
video is the result.
1.1      Networks
          A network is a set of devices (often referred to as nodes) connected by communication
 links. A node can be a computer, printer, or any other device capable of sending and/or
 receiving data generated by other nodes on the network.
 1.1.1    Components of data communication (Networking)
 A data communications system has five components.
 1.       Message. The message is the information (data) to be communicated
 2.       Sender. The sender is the device that sends the data message. It can be a computer,
          telephone handset, camera, and so on.
 CN Unit 1 :Chennai Institute of Technology                                                            1
3.       Receiver. The receiver is the device that receives the message. It can be a computer,
         telephone handset, television, and so on.
4.       Transmission medium. The transmission medium is the physical path by which a
         message travels from sender to receiver. Some examples of transmission media
         include twisted-pair wire, coaxial cable, fiber-optic cable, and radio waves
5.       Protocol. A protocol is a set of rules that govern data communications. It represents
         an agreement between the communicating devices. Without a protocol, two devices
         may be connected but not communicating, just as a person speaking French cannot be
         understood by a person who speaks only Japanese.
                       Figure 1.1 Five components of data communication
1.1.2 Application of Computer Networks
•        Internet is one of the main applications of the computer networks. Most widely used
         Internet applications are electronic mail, streaming audio and video, Word Wide
         Web, MP3 etc.
•        Major applications areas of computer networks are:
        1. Business applications         2. Home applications 3. Mobile
1.     Business applications
•       Now a days computers are being used in almost all business processes. For example,
        use of computers to monitor production, inventories, to make payments. Resource
        sharing is the important purpose of using computer networks. Resources like
        programs, equipments and data are required to share amongst various users.
i)      Database resource
•       The database is required to access for decision making by various departments. The
        database is maintained by dedicated server and users (clients) can access the data. One
        server can provide services to many clients. The client and server in a network is
        shown in Fig. 1.2. This arrangement is called as client – server model.
CN Unit 1 :Chennai Institute of Technology                                                  2
                                   Figure 1.2 Client-server model
•       Client requests for a service and server acknowledges the request. The server
        performs the requested work and sends back the result. The process of request and
        reply for a client-server model is shown in Fig. 1.3.
                       Figure 1.3 Request and reply in client-server model
ii)     Communication medium: Computer network is a powerful medium for
        communication. E-mail is very popularly used amongst company employees. Video-
        conferencing is other form of computer assisted communications.
iii)    Electronic commerce: Many companies doing business electronically with suppliers
        and customers. Customers can place order electronically; this assures fast delivery and
        efficient services.
2)      Home Applications
•       Now a days, use of computer in home is widespread. Popular uses of computers in
        home are as under.
        i) Internet access ii) Personal communication iii) Entertainment iv) Electronic
        commerce
•       Surfing on Internet may be for fun, to acquire information and for playing games.
        Information on every field is available on internet such as arts, science, technology,
        business, government, health, games, travels, music, cooking etc. Many newspapers
        are available on-line and selected articles can be downloaded.
•       Various magazines, scientific journals, e-books are available on line. Many
        professional organizations also provide their journals, conference proceedings on-line.
•       E-mail, instant messaging, chating, internet telephony, video phone provides personal
        communication by using Internet and WWW.
CN Unit 1 :Chennai Institute of Technology                                                   3
•          Entertainment applications include video on demand, interactive films and games,
           virtual reality games, line televisions where audience, participating in quiz show,
           choosing among contestants etc.
•          E-commerce facilitates home shopping, catalogs of company products, on line
           technical support. E-commerce also popularly employed for bill payments, banking,
           investments, on line auctions. Commonly used forms of e-commerce and their typical
           applications are shown below.
    Sl. No.               B-Commerce                                     Applications
      1.          Business – to – consumer        →      On line ordering
      2.          Business – to – Business        →      Supply chain management (Suppliers to
                                                                manufacturers)
      3.          Government – to – Consumer      →      Different government forms on Internet.
                                                        e.g., Income tax,       Application
                                                        forms.
      4.          Consumer – to – Consumer        →      Auctioning of second hand products.
      5.          Peer – to – peer                →      File sharing.
3)         Mobile Computers
•          Many professionals use desktop computers at office and want to be connected to the
           office network while travelling and at home also. This is possible by wireless
           networks, hence use of Lap-top, notebook computers and personal digital assistants
           (PDAs) is increased. With the help of wireless networks one can access internet, read
           and send e-mail. Wireless networks are used in:
           i)         Taxis, delivery vehicles and other mobile vehicles for keeping contacts with
                      their office.
           ii)        Geographical Information Systems (GIS).
           iii)       Military applications
           iv)        Airports
           v)         Banking
           vi)        Weather reporting
1.1.3      Requirements
•          For designing the computer network, it is necessary to identify the requirements and
           constraints. Depending upon the user or organizations, requirements are changed.
•          Following are the three parameters which affects the design:
           1.         Application programmer : Specify the list of services
CN Unit 1 :Chennai Institute of Technology                                                     4
        2.      Network designer: List the properties of a cost-effective design
        3.      Network Provider: List the properties of a system that is easy to administer
                and manage.
1.1.4   Challenges for Building Networks
1.      The Scalability and Extensible Network: The rapid growth of the Internet and network
        technologies has increased audio, video, image and graphic data applications, which
        consume large volumes of network bandwidth.
2.      Security in Computer Networks: Part of the security challenge comes from increased
        use of a divergent platforms, end-systems and network protocols.
3.      The biggest challenge of the implementation is in verifying network components to
        ensure they are capable of protecting security, privacy and reliability.
4.      Difficulty in protecting data crossing over different network components.
5.      Reliability: Reliability means availability and correctness. Systems for providing
        services must be always available and correct and commit to fulfill every request from
        the legitimate users.
6.      Protocol: Protocol indicates criteria and mechanisms used in the network’s
        communication.
1.1.5   Network Criteria
A network must be able to meet a certain number of criteria. The most important of these are
➢       Performance
➢       Reliability
➢       Security
Performance
        Performance can be measured based on transmit time and response time. Transmit
time is the amount of time required for a message to travel from one device to another.
Response time is the elapsed time between an inquiry and a response.
Throughput
•       Throughput is an actual measurement of how fast data can be transmitted whereas
        bandwidth is a potential measurement of link.
•       Throughput is usually less than bandwidth.
Latency
•       Latency is also termed as delay. Latency is time required for a message to completely
        arrive at the destination from source. If has four components propagation time,
        transmission time, queuing time and processing delay.
Reliability
        The network reliability is measured by the frequency of failure and time taken to
CN Unit 1 :Chennai Institute of Technology                                                 5
 recover from a failure
 Security
         Network security include protecting data from unauthorized access, protecting data
 from damage and development, and implementing policies and procedures for recovery from
 modifications and data losses.
 1.1.6   Physical Structures
 Type of Connection
        A network is two or more devices connected through links. There are two possible
types of connections:
         ➢      Point-to-point
         ➢        Multipoint.
 Point-to-Point
         A point-to-point connection provides a dedicated link between two devices. The entire
  capacity of the link is reserved for transmission between those two devices. Most point-to-
  point connections use an actual length of wire or cable to connect the two ends.
 Multipoint
         A multipoint (also called multidrop) connection is one in which more than two
 specific devices share a single link. In a multipoint environment, the capacity of the channel
 is shared, either spatially or temporally.
         If several devices can use the link simultaneously, it is a spatially shared connection.
 If users must take turns, it is a timeshared connection.
                  Figure 1.4 Types of connections: point-to-point and multipoint
 1.1.6.1 Physical Topology
         The term physical topology refers to the way in which a network
 CN Unit 1 :Chennai Institute of Technology                                                   6
                                 Figure 1.5 Categories of topology
        Mesh: In a mesh topology, every device has a dedicated point-to-point link to every
other device. The term dedicated means that the link carries traffic only between the two
devices it connects. To find the number of physical links in a fully connected mesh network
with n nodes, we first consider that each node must be connected to every other node. Node 1
must be connected to n - 1 nodes, node 2 must be connected to n – 1 nodes, and finally node
n must be connected to n - 1 nodes. We need n(n - 1) physical links.
        However, if each physical link allows communication in both directions (duplex
mode), we can divide the number of links by 2. In other words, we can say that in a mesh
topology, we need n(n -1) /2 duplex-mode links.
                    Figure 1.6 A fully connected mesh topology (five devices)
Advantages
            a. The use of dedicated links guarantees that each connection can carry its own
                data load.
            b. A mesh topology is robust. If one link becomes unusable, it does not
                incapacitate the entire system.
            c. Third, there is the advantage of privacy or security. When every message
                travels along a dedicated line.
            d. Point-to-point links make fault identification and fault isolation easy..
Disadvantages
1.      Disadvantage of a mesh are related to the amount of cabling because every device
        must be connected to every other device, installation and reconnection are difficult.
CN Unit 1 :Chennai Institute of Technology                                                      7
 2.      Second, the sheer bulk of the wiring can be greater than the available space (in walls,
         ceilings, or floors) can accommodate.
 3.      The hardware required to connect each link (I/O ports and cable) can be prohibitively
         expensive.
Star Topology
         In a star topology, each device has a dedicated point-to-point link only to a central
 controller, usually called a hub. The devices are not directly linked to one another. Unlike a
 mesh topology, a star topology does not allow direct traffic between devices. The controller
 acts as an exchange: If one device wants to send data to another, it sends the data to the
 controller, which then relays the data to the other connected device.
 Advantages
 1.      A star topology is less expensive than a mesh topology. In a star, each device needs
         only one link and one I/O port to connect it to any number of others. This factor also
         makes it easy to install and reconfigure.
 2.      Other advantages include robustness. If one link fails, only that link is affected. All
         other links remain active. This factor also lends itself to easy fault identification and
         fault isolation. As long as the hub is working, it can be used to monitor link problems
         and bypass defective links.
                        Figure 1.7 A star topology connecting four stations
 Disadvantage
         The star topology is the dependency of the whole topology on one single point, the
 hub. If the hub goes down, the whole system is dead. Although a star requires far less cable
 than a mesh, each node must be linked to a central hub. For this reason, often more cabling is
 required in a star than in some other topologies (such as ring or bus).
 Bus Topology
         A bus topology, is multipoint. One long cable acts as a backbone to link all the
 devices in a network. Bus topology was the one of the first topologies used in the design of
 early local area networks.
 CN Unit 1 :Chennai Institute of Technology                                                    8
                       Figure 1.8 A bus topology connecting three stations
        Nodes are connected to the bus cable by drop lines and taps. A drop line is a
connection running between the device and the main cable. A tap is a connector that either
splices into the main cable or punctures the sheathing of a cable to create a contact with the
metallic core.
Advantages
        A bus topology is easy to installation. Only the backbone cable stretches through the
entire facility.
Disadvantages
        It is difficult reconnection and fault isolation.
        Adding new devices may therefore require modification or replacement of the
backbone.
Ring Topology
        In a ring topology, each device has a dedicated point-to-point connection with only
the two devices on either side of it. A signal is passed along the ring in one direction, from
device to device, until it reaches its destination. Each device in the ring incorporates a
repeater. When a device receives a signal intended for another device, its repeater regenerates
the bits and passes them along
                        Figure 1.9 A ring topology connecting six stations
Advantages
1.      A ring is relatively easy to install and reconfigure. Each device is linked to only its
        immediate neighbors (either physically or logically). To add or delete a device
CN Unit 1 :Chennai Institute of Technology                                                  9
             requires changing only two connections. The only constraints are media and traffic
             considerations (maximum ring length and number of devices).
 2.          In addition, fault isolation is simplified. Generally in a ring, a signal is circulating at
             all times. If one device does not receive a signal within a specified period, it can issue
             an alarm. The alarm alerts the network operator to the problem and its location.
 Disadvantage
             However, unidirectional traffic can be a disadvantage. In a simple ring, a break in the
 ring (such as a disabled station) can disable the entire network. This weakness can be solved
 by using a dual ring or a switch capable of closing off the break.
 Comparison between Bus and Ring Topology
      Sl.No.                     Bus topology                             Ring topology
        1.       Bus requires proper termination. Cable Termination is not required.
                        cannot be left unterminated.
        2.       Bus is a passive network topology.           Ring is an active network topology.
        3.       There is loss in data integrity as the bus Transmission errors are minimized
                        length increases.                             because transmitted signal is
                                                                      regenerated at each node.
        4.       It uses point to multipoint communication It uses point-to-point communication
                        links.                                        links.
        5.       Recommended when large number of             Recommended         when      moderate
                        devices are to be attached.                   number of devices are to be
                                                                      attached.
1.2      Network Types: or Categories of Networks
 1.2.1       Local Area Networks (LAN)
             Local area networks, generally called LANs, are privately-owned networks within a
 single building or campus of up to a few kilometer’s in size. They are widely used to connect
 personal computers and workstations in company offices and factories to share resources
 (e.g., printers) and exchange information. LANs are distinguished from other kinds of
 networks by three characteristics:
             ➢       Their size,
             ➢       Their transmission technology, and
             ➢       Their topology.
 CN Unit 1 :Chennai Institute of Technology                                                          10
    Attributes of LAN
    ➢        The LAN transmits data amongst user stations
    ➢        The LAN transmission capacity is more than 1 Mbps.
    ➢        The LAN channel is typically privately owned by the organization using the facility
    ➢        The Geographical coverage of LANs is limited to area less than 5 square Kilometers
    1.2.2    Metropolitan Area Network (MAN)
             A metropolitan area network, or MAN, covers a city. The best-known example of a
    MAN is the cable television network available in many cities. This system grew from earlier
    community antenna systems used in areas with poor over-the-air television reception. In these
    early systems, a large antenna was placed on top of a nearby hill and signal was then piped to
    the subscribers' houses. At first, these were locally-designed, ad hoc systems. Then
    companies began jumping into the business, getting contracts from city governments to wire
    up an entire city.
                         Figure 1.10 Metropolitan area network based on cable TV.
    1.2.3    Wide Area Network (WAN)
    •        A WAN provides long distance transmission of data and voice.
•           A Network that covers a larger area such as a city, state, country or the world is called
             wide area network.
    •        The WAN contains host and collection of machines. User program is installed on the
             host and machines. All the hosts are connected by each other through communication
             subnet. Subnet carries messages from host to host.
    •        Fig. 1.11 shows the component of WAN.
    •        Subnet consists of transmission lines and switching elements. The transmission line is
             used for data transfer between two machines. Switching elements are used for
             connecting two transmission lines.
    •        Switching elements are specialized computers. It selects the proper outgoing line for
    CN Unit 1 :Chennai Institute of Technology                                                      11
           incoming data and forward the data on that line.
 •         The switching elements are basically computers and they are called packet switching
           nodes, intermediate systems and data switching exchanges. These switching elements
           are also called routers.
                                       Figure 1.11 Wide area network
 •         Each host is connected to a LAN on which a router is present. Sometimes the host can
           be directly connected to the router. The interconnection of routers forms the subnet.
 •         In the WAN, when the packet is sent from one router to another via one or more
           intermediate routers, the packet is received at each intermediate router in its entirety.
           This packet is stored in that router until the required output line is free. The subnet
           which uses this principle is called point-to-point, store and forward, or packet
           switched subnet.
 •         Almost all the WANs use store and forward subnets.
 •         If the packets are small and of same size, they are also called cells.
 •         In the point-to-point subnet, the router interconnection topology becomes important.
           WANs can also use satellite or ground radio system. The routers have antenna,
           through which they can send or receive data, they can listen from satellite.
 •         WAN uses hierarchical addressing because they facilitate routing. Addressing is
           required to identify which network input is to be connected to which network output.
Comparison between LAN, WAN and MAN
      Parameter               LAN                        WAN                        MAN
     Area covered Covers small area            Covers large              Covers larger than LAN
                     i.e. within the           geographical area.        & smaller than WAN.
                     building.
     Error rates     Lowest                    Highest                   Moderate
 CN Unit 1 :Chennai Institute of Technology                                                        12
     Transmission High speed.                    Low speed                  Moderate speed.
     speed
     Equipment           Uses inexpensive        Uses most expensive        Uses moderately
     cost                equipment               equipment.                 expensive equipment.
 1.2.4       Comparison between LAN and WAN
       Sr. No.                       LAN                                      WAN
            1.       It covers small area.                  WAN covers large geographical area.
            2.       LAN operates on the principal of WAN operates on the principal of point
                     broadcasting.                          to point.
            3.       Used for time critical application.    Not used for time critical application.
            4.       Transmission speed is high.            Transmission speed is low.
            5.       Easy to design and maintain.           Design and maintenance is not easy.
            6.       LAN is broadcasting in nature.         WAN is point-to-point in nature.
            7.       Transmission medium is co-axial Transmission              or     communication
                     or UTP cable.                          medium is PSTN or satellite link.
            8.       LAN      does   not     suffer   from WAN suffer from propagation delay.
                     propagation delay.
 1.2.5       Wireless Networks
 •           A wireless LAN or WLAN is a wireless local area network that uses radio waves as
             its carrier. The last link with the users is wireless, to give a network connection to all
             users in a building or campus. The backbone network usually uses cables.
 •           Wireless LANs operate in almost the same way as wired LANs, using the same
             networking protocols and supporting the most of the same applications.
How are WLANs Different?
 1.          They use specialized physical and data link protocols.
 2.          They integrate into existing networks through access points which provide a bridging
             function.
 3.          They let you stay connected as you roam from one coverage area to another.
 4.          They have unique security considerations.
 5.          They have specific interoperability requirements.
 6.          They require different hardware.
 7.          They offer performance that differs from wired LANs.
 CN Unit 1 :Chennai Institute of Technology                                                           13
Example 1. Consider a bus LAN with a number of equally spaced stations with a data
rate of 9 Mbps and a bus length of 1 km. What is the mean time to send a frame of 500
bits to another station, measured from the beginning of transmission to the end of
reception? Assume a propagation speed of 150 m/s. If two stations begin to monitor and
transmit at the same time, how long does it need to wait before an interference is
noticed?
Solution:        We assume that the distance between two stations is 500 m
                  Mean time to send      =    Propagation time + Transmission time
                                         =   500 m / 150 msec. + 500 bits / 9000000 bps.
                                         =   3.33 msec. + 55.55 msec. = 58.88 msec.
        If the two stations begin the transmission at exactly the same time the signal will
interface after exactly 250 m.
        Tinterface = (250 m + 250 m) / 150 m / msec = 3.33 msec                     …Ans.
1.3      Layering and Protocols
•       A computer network must provide general, cost effective, fair and robust connectivity
        among a large number of computers. Designing a network to meet these requirements
        is no small task.
•       To deal with this complexity, network designers have developed general blue prints –
        usually called network architectures. It guides the design and implementation of
        networks.
1.3.1   Layered Architecture
•       Computer network is designed around the concept of layered protocols or functions.
        For exchange of data between computers, terminals or other data processing devices,
        there is data path between two computers, either directly or via a communication
        network.
•       Protocols are the rules that govern network communication. Fig. 1.12 shows the five
        layer network.
•       Layer n on one node carries on a conversation with layer n on other node.
•       The entities comprising the corresponding layers on different machine and called
        peers.
•       The actual data flow is from upper layer to its below layer and then from physical
        medium to destination layer.
CN Unit 1 :Chennai Institute of Technology                                                  14
                       Figure 1.12 Layers, protocols and interfaces
•       Between each pair of adjacent layers is called interface. The interface defined which
        primitive operations and services the lower layer offers to the upper one.
•       A set of layers and protocols is called network architecture.
1.4     OSI Architecture
•       The ISO was one of the first organizations to formally define a common way to
        connect computers in 1947. Their architecture, called the Open System
        Interconnection (OSI).
•       The International organization for standardization developed the Open System
        Interconnection (OSI) reference model. OSI model is the most widely used model
        for networking.
•       OSI model is a seven layer standard.
•       OSI model provides following services.
        1.      Provides peer-to-peer logical services with layer physical implementation.
        2.      Provides standards for communication between system.
        3.      Defines point of interconnection for the exchange of information between
                system.
        4.      Each layer should perform a well defined function.
        5.      Narrows the options in order to increase the ability to communicate without
                expansion conversions and translations between products.
CN Unit 1 :Chennai Institute of Technology                                                   15
                                   Figure 1.13 OSI Layer model
                            Figure 1.14 OSI Layer model with Interface
Physical Layer
        Physical Layer is the lowest layer of the OSI model. The physical layer coordinates
the functions required to transmit a bit stream over a communication channel. It deals with
the mechanical and electrical specifications of the interface and transmission medium. It also
deals with procedures and functions required for transmission.
CN Unit 1 :Chennai Institute of Technology                                                 16
                                     Figure 1.15 Physical layer
Function of Physical layer
1.      Physical characteristics of interfaces and medium. The physical layer defines the
        characteristics of the interface between the devices and the transmission medium.
2.      Representation of bits. The physical layer data consists of a stream of bits (sequence
        of Os or 1s) with no interpretation. To be transmitted, bits must be encoded into
        signals--electrical or optical.
3.      Data rate. The physical layer define the transmission rate-The number of bits sent
        each second
4.      Synchronization of bits. The transmission rate and receiving rate must be same. This
        is done by synchronizing clock at sender and receiver.
5.      Line configuration. The physical layer is concerned with the connection of devices
        to the media. In a point-to-point configuration, two devices are connected through a
        dedicated link. In a multipoint configuration, a link is shared among several devices.
6.      Physical topology. The physical topology defines how devices are connected to make
        a network. Devices can be connected by using a mesh topology, star topology, a ring
        topology, a bus topology, or a hybrid topology (this is a combination of two or more
        topologies).
7.      Transmission mode. The physical layer also defines the direction of transmission
        between two devices: simplex, half-duplex, or full-duplex. In simplex mode, only one
        device can send; the other can only receive. The simplex mode is a one-way
        communication. In the half-duplex              two devices can send and receive, but not
        at the same time. In a full-duplex (or simply duplex) mode, two devices can send and
        receive at the same time.
CN Unit 1 :Chennai Institute of Technology                                                       17
 Data Link Layer
         The data link layer is responsible for transmitting frames from one node to the
 next.
                                      Figure 1.16 Data link layer
Other responsibilities of the data link layer include the following:
 1.      Framing. The data link layer divides the stream of bits received from the network
         layer into manageable data units called frames.
 2.      Physical addressing. If frames are to be distributed to different systems on the
         network, the data link layer adds a header to the frame to define the sender or receiver
         of the frame.
 3.      Flow control. When the rate of the data transmitted and rate of data reception by
         receiver is not same, same data may be lost.
 4.      Error control. The data link layer incorporate reliability to the physical layer. By
         adding mechanisms to detect and retransmit damaged or lost frames
 5.      Access control. When two or more devices are connected to the same link, data link
         layer determine which device has control over the link.
 Network Layer
         The network layer is responsible for the delivery of packet from source to
 destination possibly across multiple networks (links). The network layer ensures that each
 packet gets from its point of origin to its final destination.
                                      Figure 1.17 Network layer
 CN Unit 1 :Chennai Institute of Technology                                                   18
Other responsibilities of the network layer include the following:
1.        Logical addressing. The physical addressing implemented by the data link layer
          handles the addressing problem locally. If a packet passes the network boundary, we
          need another addressing system to help distinguish the source and destination
          systems. The network layer adds a header to the packet of upper layer includes the
          logical addresses of the sender and receiver.
2.        Routing. Network layer, route or switch the packets to its final destination in an
          internetwork.
Transport Layer
          The transport layer is responsible for delivery of message from one process to
another process. The network layer does the source-to-destination delivery of individual
packets considering it as independent packet; it does not recognize any relationship between
those packets. The transport layer ensures that the whole message arrives intact and in order
with error control and flow control at the source-to-destination level.
          Figure 2.10 shows the relationship of the transport layer to the network and session
layers.
                                  Figure 1.18     Transport layer
Other responsibilities of the transport layer include the following:
1.        Service-point addressing. Computers perform several operations simultaneously. For
          this reason, source-to-destination delivery means delivery not only from one computer to
          the next but also from a specific process (running program) on one computer to a
          specific process (running program) on the other. The transport layer header must
          therefore include a type of address called a service-point address (or port address).
2.        Segmentation and reassembly. A message is divided into segments, each segment
          containing a sequence number which enable the transport layer to reassemble at the
          destination.
CN Unit 1 :Chennai Institute of Technology                                                        19
3.      Connection control. The transport layer performs connectionless or connection
        oriented service with the destination machine.
4.      Flow control. Like the data link layer, the transport layer is responsible for flow
        control. However, flow control at this layer is performed end to end rather than across
        a single link.
5.      Error control. Like the data link layer, the transport layer is responsible for error
        control. However, error control at this layer is performed end to end rather than across
        a single link.
Session Layer
        The services provided by the first three layers (physical, data link, and network) are
not sufficient for some processes. The session layer is responsible for dialog control and
synchronization. It establishes, maintains, and synchronizes the interaction among
communicating systems.
        Specific responsibilities of the session layer include the following:
1.      Dialog control: The communication between two processes to take place in either
        half duplex (one way at a time) or full-duplex (two ways at a time) mode. The session
        layer manages control for this communication.
2.      Synchronization. The session layer adds checkpoints, or synchronization points, to a
        stream of data. For example, if a system is sending a file of 2000 pages, it is advisable
        to insert.
        Figure 1.19 illustrates the relationship of the session layer to the transport and
presentation layers.
                                      Figure 1.19 Session layer
Presentation Layer
        The presentation layer deals with the syntax and semantics of the information
exchanged between two systems. The presentation layer is responsible for translation,
compression, and encryption. Figure 1.20 shows the relationship between the presentation
layer and the application and session layers.
CN Unit 1 :Chennai Institute of Technology                                                    20
                                   Figure 1.20 Presentation layer
Specific responsibilities of the presentation layer include the following:
a.      Translation. The different computers use different encoding systems, the
        presentation layer is responsible for interoperability between these different encoding
        methods.
b.      Encryption. Encryption means that the sender transforms the original information to
        another form and sends the resulting message out over the network. Decryption
        reverses the original process to transform the message back to its original form.
c.      Compression. Data compression reduces the number of bits contained in the
        information. Data compression becomes particularly important in the transmission of
        multimedia such as text, audio, and video.
Application Layer
        The application layer is responsible for providing services to the user. It provides
user interfaces and support for services such as electronic mail, remote file access and
transfer, shared database management, and other types of distributed information services.
        Figure 1.21 shows the relationship of the application layer to the user and the
presentation layer.
                                   Figure 1.21 Application layer
CN Unit 1 :Chennai Institute of Technology                                                   21
Specific services provided by the application layer include the following:
a.      Network virtual terminal. A network virtual terminal is a software version of a
        physical terminal that allows a user to log on to a remote host.
b.      File transfer, access, and management. This application allows a user to access files in
        a remote host, to retrieve files from a remote computer for use in the local computer,
        and to manage or control files in a remote computer locally.
c.      Mail services. This application provides the basis for e-mail forwarding and storage.
d.      Directory services. This application provides distributed database sources and access
        for global information.
Summary of Layers
Figure 1.25 shows a summary of duties for each layer.
                                   Figure1.25 Summary of layers
1.5 TCP/IP Protocol Suite (Internet Architecture)
        The TCPIIP protocol suite was developed prior to the OSI model. Therefore, the
layers in the TCP/IP protocol suite do not exactly match those in the OSI model. The original
TCP/IP protocol suite was defined as having four layers:
        ➢       Host-to-network Layer
        ➢       Internet Layer
        ➢       Transport Layer
        ➢       Application Layer.
CN Unit 1 :Chennai Institute of Technology                                                   22
                                Figure 1.26 TCP/IP and OSI model
Physical and Data Link Layers
        At the physical and data link layers, TCP/IP does not define any specific protocol. It
supports all the standard and proprietary protocols. A network in a TCP/IP internetwork can
be a local-area network or a wide-area network.
Network Layer
        At the network layer (or, more accurately, the internetwork layer), TCP/IP supports
the Internetworking Protocol. IP, in turn, uses four supporting protocols: ARP, RARP, ICMP, and
IGMP.
Internetworking Protocol (IP)
        The Internetworking Protocol (IP) is the transmission mechanism used by the TCP/IP
protocols.
Address Resolution Protocol
        The Address Resolution Protocol (ARP) is used to associate a logical address with a
physical address.
Reverse Address Resolution Protocol
        The Reverse Address Resolution Protocol (RARP) allows a host to discover its
Internet address when it knows only its physical address.
Internet Control Message Protocol
        The Internet Control Message Protocol (ICMP) is a mechanism used by hosts and
gateways to send notification of datagram problems back to the sender.
CN Unit 1 :Chennai Institute of Technology                                                  23
Internet Group Message Protocol
         The Internet Group Message Protocol (IGMP) is used to facilitate the
simultaneous transmission of a message to a group of recipients.
Transport Layer
         Traditionally the transport layer was represented in TCP/IP by two protocols:
User Datagram Protocol
         The User Datagram Protocol (UDP) is the simpler of the two standard TCP/IP
transport protocols. It is a process-to-process protocol that adds only port addresses,
checksum error control, and length information to the data from the upper layer
Transmission Control Protocol (TCP)
         It provides full transport-layer services to applications. TCP is a reliable stream
transport protocol. And it is connection-oriented: A connection must be established between
both ends of a transmission before either can transmit data.
Stream Control Transmission Protocol
         The Stream Control Transmission Protocol (SCTP) provides support for newer
applications such as voice over the Internet.
Application Layer
         The application layer in TCP/IP is equivalent to the combined session, presentation,
and application layers in the OSI model.
1.5.1 Comparison of the OSI and TCP/IP Protocol Suite
 Sl. No.                   OSI Model                                TCP/IP Model
    1.      7 layers                                   4 layers
    2.      Model was first defined before Model defined after protocols were
            implementation takes place.                implemented.
    3.      OSI model based on three concept TCP/IP model did not originally clearly
            i.e. service, interface and protocol.      distinguish between service, interface and
                                                       protocol.
    4.      OSI    model      gives   guarantee     of Transport    layer   does    not    always
            reliable delivery of packet.               guarantee the reliable delivery of packet.
    5.      OSI    does    not    support    internet TCP/IP support.
            working
    6.      Strict layering                            Lossely layered.
CN Unit 1 :Chennai Institute of Technology                                                          24
     7.      Support     connections         less   and Support       only      connection-oriented
             connection-oriented communication            communication in the transport layer.
             in the network layer.
1.5.2     Addressing
•         An Internet employing TCP / IP protocols uses four levels of addresses:
          1. Physical (Link) addresses              2. Logical (IP) addresses
          3. Port addresses                         4. Specific addresses
•         Each address type is related to a specific layer in TCP / IP architecture. Fig.1.27
          shows the relationship of layers and addresses in TCP / IP.
                       Figure 1.27 TCP / IP layers and associated addresses
1.        Physical Addresses
•         The physical address is the lowest level address and is also refereed as link address.
          They physical address of a node is defined by its LAN or WAN. The physical address
          is included in the frame by the data link layer.
•         The size and format of physical addresses vary depending on the network. It has
          authority over the network. At data link layer the frame contains physical (link)
          addresses in the header.
2.        Logical Addresses
•         Logical addresses are independent of underlying physical networks. Since different
          networks can have different address formats hence a universal address system is
          required which can identify each host uniquely irrespective of underlying physical
          networks. Logical addresses are necessary for universal communications. It is 32-bit
CN Unit 1 :Chennai Institute of Technology                                                        25
        address which uniquely defines host connected to Internet.
                                   Fig. 1.28. Physical addresses
•       The physical addresses changes from hop to hop, but the logical address usual remains
        the same.
3.      Port Addresses
•       The IP address and physical address are necessary for data to travel from source to
        destination. But a communication process involves TELNET and FTP which requires
        addresses. In TCP/IP architecture, the label assigned to a process is called port
        address. In TCP/IP the port address is of 16-bit.
4.      Specific Addresses
•       Specific addresses are designed by users for some applications. For example
        evilaas@in.com and the Universal Resource Locator (URL), www.vtubooks.com. The
        first example defines the recipient of e-mail and second example is used to find a
        document on the world wide web.
•       The specific addresses gets changed to corresponding port and logical addresses by
        the station or host who sends it.
CN Unit 1 :Chennai Institute of Technology                                                26
The physical components of a computer network include hardware devices and media that enable
connectivity and data exchange between devices. The server, client, peer, transmission media, and
connecting devices make up the hardware components. The operating system and protocols are examples
of software components. A computer network is made up of several computers connected so that
resources and data can be shared. In this article, we will discuss every point about the physical component
of a computer network.
Types of Physical Components
A computer network consists of several physical components. In other words, two or more devices are
connected via a computer network to exchange an almost infinite amount of data and services. Here
Below are some physical components of computer Networks:
1. NIC(Network Interface Card)
NIC or Network Interface Card is a network adapter used to connect the computer to the network. It is
installed in the computer to establish a LAN. It has a unique ID that is written on the chip, and it has a
connector to connect the cable to it. The cable acts as an interface between the computer and the router or
modem. NIC card is a layer 2 device, which means it works on the network model’s physical and data
link layers.
Types of NIC
Wired NIC: Cables and Connectors use Wired NIC to transfer data.
Wireless NIC: These connect to a wireless network such as Wifi, Bluetooth, etc.
2. HUB
A hub is a multi-port repeater. A hub connects multiple wires coming from different branches, for
example, the connector in star topology which connects different stations. Hubs cannot filter data, so data
packets are sent to all connected devices. In other words, the collision domain of all hosts connected
through hub remains one. Hub does not have any routing table to store the data of ports and map
destination addresses., the routing table is used to send/broadcast information across all the ports.
Types of HUB
Active HUB: Active HUB regenerates and amplifies the electric signal before sending them to all
connected device. This hub is suitable to transmit data for long distance connections over the network.
Passive HUB: As the name suggests it does not amplify or regenerate electric signal, it is the simplest
types of Hub among all and it is not suitable for long-distnace connections.
Switching HUB: This is also known as intelligent HUB, they provide some additional functionality over
active and passive hubs. They analyze data packets and make decisions based on MAC address and they
are operated on DLL(Data Link Layer).
3. Router
A Router is a device like a switch that routes data packets based on their IP addresses. The router is
mainly a Network Layer device. Routers normally connect LANs and WANs and have a dynamically
updating routing table based on which they make decisions on routing the data packets. The router divides
the broadcast domains of hosts connected through it.
Types of Router
There are several types of routers available in the market, Some of them are mentioned in the given link:
Types of Routers
4. Modem
    CN Unit 1 :Chennai Institute of Technology                                                      27
A Modem is a short form of Modulator/Demodulator. The Modem is a hardware component/device that
can connect computers and other devices such as routers and switches to the internet. Modems convert or
modulate the analog signals coming from telephone wire into a digital form that is in the form of 0s and
1s.
Types of Modem
There are multiple types of Modem available you can visit the page where you find Types of Modems
5. Switch
A Switch is a multiport bridge with a buffer and a design that can boost its efficiency(a large number of
ports implies less traffic) and performance. A switch is a data link layer device. The switch can perform
error checking before forwarding data, which makes it very efficient as it does not forward packets that
have errors and forward good packets selectively to the correct port only.
Types of Switch
There are different types of switches in computer networks, visit the webpage and learn how many Types
of Switches are there.
6. Nodes
Node is a term used to refer to any computing devices such as computers that send and receive network
packets across the network.
Types of nodes
End Nodes: These types of nodes are going to be the starting point or the end point of communication.
E.g., computers, security cameras, network printers, etc.
Intermediary Nodes: These nodes are going to be in between the starting point or end point of the end
nodes. E.g., Switches, Bridges, Routers, cell towers, etc.
7. Media
It is also known as Link which is going to carry data from one side to another side. This link can be Wired
Medium (Guided Medium) and Wireless Medium (Unguided Medium). It is of two types:
7.1 Wired Medium
Ethernet: Ethernet is the most widely used LAN technology, which is defined under IEEE standards
802.3. There are two types of Ethernet:
Fibre Optic Cable: In fibre optic cable data is transferred in the form of light waves.
Fibre Optic Cabel
Fibre Optic Cable
Coaxial Cable: Coaxial Cable is mainly used for audio and video communications.
USB Cable: USB Stands for Universal Serial Bus it is mainly used to connect PCs and smartphones.
7.2 Wireless Medium
Infrared (E.g. short-range communication – TV remote control).
Radio (E.g. Bluetooth, Wi-Fi).
Microwaves (E.g. Cellular system).
Satellite (E.g. Long range communications – GPS).
8. Repeater
Repeater is an important component of computer networks as it is used to regenerate and amplify signal
in the computer networks. Repeaters are used to improve the quality of the networks and they are
    CN Unit 1 :Chennai Institute of Technology                                                      28
operated on the Physical Layer of the OSI Model.
Repeater
Repeater
Types of Repeaters
There are several types of repeaters based on specifications you can check by tapping the link Types of
Repeaters.
9. Server
A server is a computer program that provides various functionality to another computer program. The
server plays a vital role in facilitating communication, data storage, etc. Servers have more data storage as
compared to normal computers. They are designed for the specific purpose of handling multiple requests
from clients.
3.5 IP addressing or Logical Addressing - IPv4 Addresses
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for
example, a computer or a router) to the Internet. IPv4 addresses are unique.
  1. Address Space
A protocol such as IPv4 that defines addresses has an address space. An address space is the total number
of addresses used by the protocol. If a protocol uses N bits to define an address, the address space is 2n
because each bit can have two different values (0 or 1) and N bits can have 2n values.
IPv4 uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296 (more than 4
billion).
  2. Notations
binary notation and dotted decimal notation.
  a. Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. The following is an example of an IPv4
address in binary notation.
01110101 10010101 00011101 00000010
  b. Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read, Internet addresses are usually written in
decimal form with a decimal point (dot) separating the bytes. The following is the dotted-decimal notation
of the above address:
117.149.29.2
Figure 3.4 shows an IPv4 address in both binary and dotted-decimal notation. Note that because each byte
(octet) is 8 bits, each number in dotted-decimal notation is a value ranging from 0 to 255
Fig 3.4 Dotted decimal notation and binary notation for an IPv4 address
Example 3.1
Change the following IPv4 addresses from binary notation to dotted-decimal notation. a)10000001
00001011 00001011 11101111
b)11000001 10000011 00011011 11111111
Solution
We replace each group of 8 bits with its equivalent decimal number and add dots for separation.
     CN Unit 1 :Chennai Institute of Technology                                                      29
a)129.11.11.239
b)193.131.27.255
Example 3.2
Change the following IPv4 addresses from dotted-decimal notation to binary notation. a)111.56.45.78
b)221.34.7.82
Solution
We replace each decimal number with its binary equivalent. a)01101111 00111000 00101101 01001110
b)11011101 00100010 00000111 01010010
  3.1 Classful Addressing
In classful addressing, the address space is divided into five classes: A, B, C, D, and E.
If the address is given in binary notation, the first few bits can immediately tell us the class of the address.
If the address is given in decimal-dotted notation, the first byte defines the class. Both methods are shown
in Figure 3.5.
Fig 3.5 Finding the classes in binary and dotted decimal notation
Example 3.4
Find the class of each address.
a)00000001 00001011 00001011 11101111
b)11000001 10000011 00011011 11111111
c) 14.23.120.8 d)252.5.15.111
Solution
 a) The first bit is O. This is a class A address.
 b) The first 2 bits are 1; the third bit is O. This is a class C address.
 c) The first byte is 14 (between 0 and 127); the class is A.
 d) The first byte is 252 (between 240 and 255); the class is E.
  3.1.1 Classes and Blocks
One problem with classful addressing is that each class is divided into a fixed number of blocks with each
block having a fixed size as shown in Table 3.1.
Netid and Hostid
In classful addressing, an IP address in class A, B, or C is divided into netid and hostid.
     CN Unit 1 :Chennai Institute of Technology                                                         30
The netid is in color, the hostid is in white. Note that the concept does not apply to classes D and
E. In class A, one byte defines the netid and three bytes define the hostid. In class B, two bytes define the
netid and two bytes define the hostid. In class C, three bytes define the netid and one byte defines the
hostid.
Sub netting
If an organization was granted a large block in class A or B, it could divide the addresses into several
contiguous groups and assign each group to smaller networks (called subnets).
Classless Addressing
To overcome address depletion and give more organizations access to the Internet, classless addressing
was designed and implemented. In this scheme, there are no classes, but the addresses are still granted in
blocks.
Mask
A mask is a 32-bit number in which the n leftmost bits are 1s and the 32 - n rightmost bits are 0s.
 First Address: The first address in the block can be found by setting the 32 - n rightmost bits inthe
binary notation of the address to 0s.
Example 3.6
A block of addresses is granted to a small organization. We know that one of the addresses is
205.16.37.39/28. What is the first address in the block?
Solution
The binary representation of the given address is 11001101 00010000 00100101 00100111. If
we set 32 - 28 rightmost bits to 0, we get 11001101 000100000100101 0010000 or 205.16.37.32.
 Last Address: The last address in the block can be found by setting the 32 - n rightmost bits in the
binary notation of the address to Is.
Example 3.7
Find the last address for the block in Example 3.6.
Solution
The binary representation of the given address is 11001101 000100000010010100100111. If we set 32 -
28 rightmost bits to 1, we get 11001101 00010000 001001010010 1111 or 205.16.37.47.
  3.3 Network Addresses
A very important concept in IP addressing is the network address.
  3.3.1 Hierarchy
IP addresses, like other addresses or identifiers we encounter these days, have levels of hierarchy. For
example, a telephone network in North America has three levels of hierarchy. The leftmost three digits
define the area code, the next three digits define the exchange, the last four digits define the connection of
the local loop to the central office. Figure 3.7 shows the structure of a hierarchical telephone number
Fig 3.7 : Hierarchy in a telephone network in North America Two-Level Hierarchy: No Subnetting
     CN Unit 1 :Chennai Institute of Technology                                                       31
Figure 3.8 shows the hierarchical structure of an IPv4 address.
Fig 3.8 : Two levels of hierarchy in an IPv4 address The prefix is common to all addresses in the network;
. Note that in our example, the subnet prefix length can differ for the subnets as shown in Figure 3.9.
Fig 3.9 : Three level hierarchy in an IPv4 address
  3.3.2 Sub netting a Network
          If a organization is large or if its computers are geographically dispersed, it makes good sense to
          divide network into smaller ones, connected together by routers. The benefits for doing things
          this way include.
          1.       Reduced network traffic
          2.       Optimized network performance
          3.       Simplified network management
          4.       Facilities spanning large geographical distances.
subnet mask code
1 = Positions representing network or subnet addresses. 0 = Positions representing the host address.
Subnet mask format
1111 1111. 1111            1111 1111 1111 0000 0000
Network address positions          Subnet positions          Host positions
The subnet mask can also be denoted using the decimal equivalents of the binary patterns. The default
subnet masks for the different classes of networks are as below in Table 3.3.1
          Class               Format                              Default subnet mask
          A                   Net.Node.Node.Node                  255.0.0.0
          B                   Net.Net.Node.Node                   255.255.0.0
          C                   Net.Net.Net.Node                    255.255.255.0
Table 3.3.1 Default subnet mask of IP address Masking
     CN Unit 1 :Chennai Institute of Technology                                                       32
 1.       How many subnets?
          Number of subnet is calculated as follows :      , Number of subnet = 2x
Where x is the number of masked bits or the 1s (ones).
For example 11100000, the number of 1s gives us 23 subnets. In this example there are 8 subnets.
 2.       How many host per subnet ?
Number of host per subnet = 2y– 2
Where y is the number of unmasked bits or the 0s (zeros)
For example 11100000, the number of 0s gives us 25 – 2 hosts. In this example there are 30 hosts per
subnet. Your need to subtract 2 for subnet address and the broadcast address.
 3.       What are the valid subnets?
For valid subnet = 256 – Subnet mask = Block size. An example would be 256 – 224 =
32. The block size of a 224 mask is always 32.
Start counting at zero in block of 32 until you reach the subnet mask value and these are your subnets. 0,
32, 64, 96, 128, 160, 192, 224.
 4.       What is the broadcast address for each subnet ?
Our subnets are 0, 32, 64, 96, 128, 160, 192, 224, the broadcast address is always the number right before
the next subnet. For example, the subnet 0 ha a broadcast address of 31 because next subnet is 32. The
subnet 32 has a broadcast address of 63 because next subnet is 64.
 5.       What are the valid hosts ?
Valid hosts are the numbers between the subnets, omitting the all 0s and all 1s. For example, if 32 is the
subnet number and 63 is the broadcast address, then 32 to 63 is the valid host range. It is always between
the subnet address and the broadcast address.
Example 3.3.2 What is the sub-network address if the destination address is 200.45.34.56 and the subnet
mask is 255.255.240.0 ?
Solution: Using AND operation, we can find sub-network address,
 1.       Convert the given destination address into binary format: 200.45.34.56 =>11001000
          0010110100100010 00111000
 2.       Convert the given subnet mask address into binary format: 255.255.240.0 =>11111111
          1111111111110000 00000000
 3.       Do the AND operation using destination address and subnet mask address. 200.45.34.56
          =>11001000 0010110100100010 00111000
255,255.240.0 =>          11111111 1111111111110000 00000000
11001000 0010110100100000 00000000
Subnet work address is 200.45.32.0
Example 3.3.2 For a network address 192.168.10.0 and subnet mask 255.255.255.224 then calculate:
         i)       Number of subnet and number of host
         ii)      Valid subnet
Solution: Given network address 192.168.10.0 is class C address. Subnet mask address is
255.255.255.224. Here three bits is browse for subnet.
 i)      Number of subnet and number of host
255.255.255.224 convert into binary =>11111111 11111111 11111111 11100000
Number or subnet = 2x = 23 = 8 So there are 8 subnet.
Number of host per subnet = 2y - 2 = 25-2 = 30
 ii)     Valid subnets
For valid subnet = 256 - Subnet mask = Block size. An example would be 256 - 224 = 32. The block size
of a 224 mask is always 32.
Start counting at zero in block of 32 until you reach the subnet mask value and these are your subnets. 0,
32, 64, 96,128,160,192, 224.
Example 3.3.3Find the sub-network address for the fallowing;
      CN Unit 1 :Chennai Institute of Technology                                                   33
              Sr. No.                IP address                    Mask
              a)                     140.11.36.22                  255.255.255.0
              b)                     120.14.22.16                  255.255.128.0
Solution
 a)      IP address      Mask 140.11.36.22      255.255.255.0
The values of mask (i.e. 255.255.255.0) is boundary level. So IP address 140.11.36.22
Mask 255.255.255.0
140.11.36.0
b)      IP address       140.11.36.22
Mask 255.255.128.0
Example 3.3.4Find the sub-network address for the fallowing;
              Sr. No.                IP address                    Mask
              a)                     141.181.14.16                 255.255.224.0
              b)                     200.34.22.156                 255.255.255.240
              c)                     125.35.12.57                  255.255.0.0
      CN Unit 1 :Chennai Institute of Technology                                        34
     Solution
     a)141.181.14.16IP address
     255.255.224.0 Mask
     141.181.0.0      Sub-network address
     b)
                      200.34.22.156                              IP address
                      255.255.255.240                            Mask
                      200.34.22.144                              Sub-network address
                      c)
                      125.35.12.57                               IP address
                      255.255.0.0                                Mask
                      125.35.0.0                                Sub-network address
     (i.e. 128) So for byte-3 value use bite-wise AND operators. It is shown below.
                                      120.14.22.16              IP address
                                      255.255.128.0             Mask
                                    125.14.0.0               Sub-network address
     In the above example, the bite wise ANDing is done in between 22 and 128. It is as follows.
                    22              Binary representation           00010110
                    128             Binary representation           10000000
                     0                                                   00000000
     Thus the sub-network address for this is 120.14.0.0.
     Example 3.3.5 Finde the class of the following address.
     a) 1.22.200.10 b) 241.240.200.2           c) 227.3.6.8     d) 180.170.0.2
     Solution:        a) 1.22.200.10 Class A IP address
       b)      241.240.200.2 Class E IP address
       c)      227.3.6.8      Class D IP address
       d)      180.170.0.2 Class B IP address
     Example 3.3.6Find the retid and Hositd for the following.
     a) 19.34.21.5 b) 190.13.70.10 c) 246.3.4.10 d) 201.2.4.2
     Solution
     a)       netid => 19     Hostid => 13.70.10
     b)       netid => 190.13 Hostid => 70.10
       c)      No netid and No Hostid because 246.3.4.10 is the class E address.
       d)      netid =>201.2.4        Hostid =>2
     Example 3.3.7: Consider sending a 3500 - byte datagram that has arrived at a router R1that needs to be sent over a
     link that has an MTU size of 1000 bytes to R2. Then it has to traverse a link with an MTU of 600 bytes. Let the
     identification number of the original datagram be 465.
     How many fragments are delivered at the destination ? Show the parameters associated with each of these fragments.
     Solution: The maximum size of data field in each fragment = 680 (because there are 20 bytes IP header). Thusthe
     number of required fragments) = [3500 - 20/680] - 5.11 ~ 6.
     Each fragment will have Identification number 465. Each fragment except the last one will be of size 700 bytes
     (including IP header). The last datagram will be of size 360 bytes (including IP header). The offsets of the4
     fragments will be 0, 85, 70, 255. Each or the first 3 fragments will have flag=l; the last fragment will have flag=0.
     Example 3.10
ICS : UNIT II Fundamentals of Networking : Chennai Institute of Technology                              Page 11
     An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute
     these addresses to three groups of customers as follows:
       a)     The first group has 64 customers; each needs 256 addresses.
       b)     The second group has 128 customers; each needs 128 addresses.
       c)     The third group has 128 customers; each needs 64 addresses.
     Design the sub blocks and find out how many addresses are still available after these allocations.
     Solution
     Figure 3.11 shows the situation.
     Fig 3.11 An example of address allocation and distribution by an ISP
      1. Group 1
     For this group, each customer needs 256 addresses. This means that 8 (log2256) bits are needed to define each host.
     The prefix length is then 32 - 8 =24. The addresses are
     1st Customer: 190.100.0.0/24 100.0.255/24
ICS : UNIT II Fundamentals of Networking : Chennai Institute of Technology                              Page 12
     2nd Customer: 190.100.1.0/24190 190.100.1.255/24
     64th Customer: 190.100.63.0/24 190.100.63.255/24 Total =64 X 256 =16,384
      2. Group2
     For this group, each customer needs 128 addresses. This means that 7 (10g2 128) bits are needed to define each host.
     The prefix length is then 32 - 7 =25. The addresses are
      3. Group3
     For this group, each customer needs 64 addresses. This means that 6 (log2 64) bits are needed to each host. The
     prefix length is then 32 - 6 =26. The addresses are
     1st Customer: 190.100.128.0/26 190.100.128.63/26
     2nd Customer: 190.100.128.64/26 190.100.128.127/26
     128th Customer: 190.100.159.192/26 190.100.159.255/26 Total =128 X 64 =8192
     Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of
     available addresses: 24,576
     Example 3.3.8Consider sending a 2400-byte datagram into link that has an MTU of 700 bytes. Suppose the original
     datagram is stamped with the identification number 422. How many fragments are generated? What are the values in
     the various fields in the IP datagram(s) generated related to fragmentation.
     Solution: The maximum size of data field in each fragment = 680 (because there are 20 bytes IP header).
     Thus the number of required fragments = (2400 - 20) / 680 =4
     Each fragment will have Identification number 422. Each fragment except that last one to be of size 700 bytes
     (including IP header.
     The last datagram will be of size 360 bytes (including IP header). The offsets of the 4 fragments will be 0, 85, 170,
     255.
     Each of the first 3 fragments will have flag = 1; last fragment will have flag = 0.
     Example 3.3.9 Suppose all the interfaces in each of three subnets are required to have the prefix 223.1.17/24.Also
     suppose that subnet 1 is required to support at least 60 interfaces, Subnet 2 is to support at least 90 interfaces and
     subnet 3 is to support at least 22 interfaces. Provide three network addresses that satisfy these constraints.
     Solution: The network address cannot be used for an interface (Network prefix + all zeros).
               The broadcast address cannot be used for an interface (Network prefix + all ones)
     Subnet 2 (90 interfaces)
     2n - 2 ≥90
ICS : UNIT II Fundamentals of Networking : Chennai Institute of Technology                               Page 13
Notice that we subtract 2 from the total number of available IP addresses because 2 IP addresses
are reserved for the network and broadcast addresses.
2n≥ 92 n = 7
Number of bits allocated to host part =n = 7
Number of bits allocated to network part = Pre filength = 32 - n = 32 - 7 = 25
The network address of the first subnet is always the address of the given address space. Network
address of first subnet = 223.1.17.0/25 = 223.1.17/25
To obtain the broadcast address of a subnet, we keep to network part of the subnet’s network
address as it is, and convert all bits in its host part to 1s.
Broadcast address of first subnet = 223.1.17.01111111 / 25 = 223.1.1.7.127/25
Subnet 1 (60 interfaces)
2n - 2 ≥ 60
Notice that we subtract 2 from the total number of available IP addresses because 2 IP addresses
are reserved for the network and broadcast addresses.
2n ≥ 60 n =6
Number of bits allocated to host part = n = 6
Number of bits allocated to network part = Prefix length = 32 - n = 32 - 6 = 26 The network address
of any subnet (that is NOT the first subnet) is obtained by adding one to the broadcast address of its
preceding subnet.
Network address of second subnet = 223.1.17.128/26
Broadcast address of second subnet = 223.1.17.10111111/26 =223.1.17.191/26 Subnet 3 (12
interfaces) :
2n- 2 ≥ 12
Notice that we subtract 2 from the total number of available IP addresses because 2 IP addresses
are reserved for the network and broadcast addresses.
2n≥ 14 n = 4
Number of bits allocated to host part = n = 4
Number of bits allocated to network part = Prefix length = 32 - n = 32 - 4 = 28 Network address of
third subnet = 223.1.17.192/28
Routing and Switching Basics for Cyber and Network Security
Interested in the field of cyber and network security? One important aspect you'll need to know
about is routing and switching. Routing and switching are the two main functions of a network.
Their purpose is to connect the different segments of your network infrastructure.
Let’s take a look at what routers and switches actually do, what their role is with regard to network
security, and the latest developments in routing and switching technology that are occurring in the
world at this very moment.
Switching Basics for Cyber and Network Security
Network switches are used to connect computers and servers into a single network. The switch
performs the function of a controller and allows the devices within a network to communicate with
each other. This action is performed through packet switching, where data is received, processed,
and forwarded to its destination from one computer to another. Information sharing as well as
resource allocation through switching allows businesses to save money while improving
productivity.
Routing Basics for Cyber and Network Security
While switches connect computers within a single network, routers are used to connect entire
networks to each other. Data packets are received, processed, and forwarded from one network to
another. Routing allows computers to link through the internet, thus allowing for information
sharing between different networking systems.
Difference between Routing and Switching
Whereas switching creates a single network made up of individual computers, routing connects
entire networks to each other. Routers perform a role similar to that of switches, but on a much
                                                                                                         2
                                                                                                         4
larger scale. Thus, a router essentially acts as a dispatcher of data through the most efficient
channels between networks.
Network Security Basics
What does routing and switching have to do with network security? Since information between
computers and larger networks is transferred using routers and switches, they become the primary
targets for hacking and information leaking. Thus, to ensure network security, it becomes essential
to protect routers and switches against outside tampering.
Facets of Router and Switch Security
Router and switch security is becoming increasingly more sophisticated, and mainly deals with the
following security concerns:
1. User Authentication
This involves any measures taken within a computer or a network, to ensure the computer user's
identity. ID theft is becoming increasingly more common in the digital world, making it an
increasingly important facet of network security.
2. Next Gen Firewalls
An integrated platform that is used to combine the traditional firewall with other network filtering
devices to provide greater network security. The platform performs several security checks
simultaneously through data packet inspection, and employing some manner of intrusion and
prevention system, along with antivirus inspection and third party integration.
3. Intrusion Detection
This is a software or device feature that is used to monitor a computer or a network of computers in
order to detect malicious activity or possible violations of network policy. In the event of a problem
being detected that could compromise network security, the software sends an immediate alert to
the relevant authorities, and, depending on the setting, takes some form of action to shut down the
lines of communication with the device posing a threat.
4. Intrusion Prevention
The purpose of this kind of software is to take a preemptive approach towards network security.
The device is programmed to actively take part in the identification of potential threats to network
security and take swift action against them before the threat becomes a reality. Similar to an
intrusion detection system, an intrusion prevention system monitors network traffic, but plays a
more directly active role in neutralizing threats to security.
5. Port Level Filters and Checks
Thanks to the internet, information can be shared more quickly than ever, through the world wide
network. The improvement in data sharing has also resulted in increasingly more mobile methods
of data collection and transfer, such as thumb drives and hard disks. In order to ensure the network
security is not threatened by these external devices, various port filters are available for the
monitoring and detection of malicious software hiding within the external drives, which can enter
the network through ports which are left unguarded.
Switching:
       Switching is process to forward packets coming in from one port to a port leading towards the
destination. When data comes on a port it is called ingress, and when data leaves a port or goes out
it is called egress. A communication system may include number of switches and nodes.
Circuit Switching
When two nodes communicate with each other over a dedicated communication path, it is called
circuit switching. There 'is a need of pre-specified route from which data will travels and no other
data is permitted. In circuit switching, to transfer the data, circuit must be established so that the
data transfer can take place.
                                                                                                         2
                                                                                                         5
Circuits can be permanent or temporary. Applications which use circuit switching may have to go
through three phases:
    • Establish a circuit
    • Transfer the data
    • Disconnect the circuit
Circuit switching was designed for voice applications. Telephone is the best suitable example of
circuit switching. Before a user can make a call, a virtual path between caller and callee is
established over the network.
Packet Switching
Shortcomings of message switching gave birth to an idea of packet switching. The entire message
is broken down into smaller chunks called packets. The switching information is added in the
header of each packet and transmitted independently.
It is easier for intermediate networking devices to store small size packets and they do not take
much resources either on carrier path or in the internal memory of switches.
Packet switching enhances line efficiency as packets from multiple applications can be multiplexed
over the carrier. The internet uses packet switching technique. Packet switching enables the user to
differentiate data streams based on priorities. Packets are stored and forwarded according to their
priority to provide quality of service.
Wireless Networking Fundamentals
                        Wireless networking refers to the technology that allows devices to
connect and communicate without using physical cables. It relies on radio waves or other
wireless signals to transmit data between devices, such as computers, smartphones, tablets,
and other networked equipment. Here are the fundamentals of wireless networking:
                                                                                                       2
                                                                                                       6
1. Basic Concepts
Wireless Networks: A network that allows devices to communicate and share resources
without physical connections (wires). Common types include Wi-Fi, Bluetooth, and
cellular networks.
Radio Frequency (RF): Wireless networking relies on RF signals to transmit data over the
air. RF signals are electromagnetic waves used in various wireless communication
standards.
Spectrum: The range of frequencies available for wireless communication. Different
wireless technologies use different parts of the spectrum.
2. Types of Wireless Networks
Wi-Fi (Wireless Fidelity): The most common wireless networking technology, primarily
used for local area networking (LAN). Wi-Fi operates on the 2.4 GHz and 5 GHz
frequency bands.
Bluetooth: A short-range wireless technology used for connecting devices like headphones,
keyboards, and mice. Operates in the 2.4 GHz band.
Cellular Networks: Used for mobile communications, including 3G, 4G, and 5G networks.
These networks operate on a variety of frequency bands allocated for mobile
communication.
Satellite Networks: Used for communication in remote areas where traditional cellular or
Wi-Fi networks are unavailable. Data is transmitted via satellites orbiting the Earth.
3. Key Components
Wireless Access Point (WAP): A device that allows wireless devices to connect to a wired
network using Wi-Fi. It acts as a bridge between the wireless devices and the wired
network.
Router: A device that routes data between different networks. In a wireless network, a
router often combines the functions of a WAP and a traditional router.
Wireless Adapter: A hardware component (e.g., USB dongle, internal card) that allows a
device to connect to a wireless network.
Antenna: A component that transmits and receives radio waves. Antennas are crucial in
determining the range and strength of a wireless signal.
4. Wireless Standards
IEEE 802.11: A set of standards for wireless local area networking (Wi-Fi). Common
versions include:
802.11a: Operates in the 5 GHz band, with speeds up to 54 Mbps.
802.11b: Operates in the 2.4 GHz band, with speeds up to 11 Mbps.
802.11g: Also operates in the 2.4 GHz band, with speeds up to 54 Mbps.
802.11n: Operates in both 2.4 GHz and 5 GHz bands, with speeds up to 600 Mbps.
802.11ac: Operates in the 5 GHz band, with speeds up to 1 Gbps.
802.11ax (Wi-Fi 6): The latest standard, operating in both 2.4 GHz and 5 GHz bands, with
speeds up to 10 Gbps and improved efficiency in dense environments.
Bluetooth: Governed by the IEEE 802.15.1 standard, designed for short-range
communication.
Cellular Standards: Governed by standards such as GSM, CDMA, LTE, and 5G NR.
5. Wireless Security
WEP (Wired Equivalent Privacy): An older security protocol for Wi-Fi, now considered
insecure due to vulnerabilities.
WPA/WPA2 (Wi-Fi Protected Access): Improved security protocols with stronger
encryption. WPA2 is widely used, while WPA3 is the latest and most secure version.
SSID (Service Set Identifier): The name of a Wi-Fi network. Configuring SSID
broadcasting and using strong passwords are essential for securing a wireless network.
                                                                                            2
                                                                                            7
Encryption: Wireless data should be encrypted to prevent unauthorized access. WPA2 and
WPA3 use AES (Advanced Encryption Standard) for secure encryption.
6. Wireless Networking Modes
Infrastructure Mode: The most common mode, where devices connect to a central WAP
(like a router) to access the network.
Ad-Hoc Mode: A peer-to-peer mode where devices communicate directly with each other
without a central access point.
Mesh Networks: A network topology where each device (or node) can communicate with
multiple other nodes, creating a network that can self-heal and extend over large areas.
7. Challenges in Wireless Networking
Interference: Wireless signals can be affected by other electronic devices, physical
obstacles (like walls), and other wireless networks operating on the same frequency.
Range and Coverage: The range of wireless networks can vary depending on the
technology used, obstacles, and the environment. Extenders, repeaters, or mesh networks
are often used to improve coverage.
Security: Ensuring wireless networks are secure is critical to prevent unauthorized access
and data breaches.
8. Applications of Wireless Networking
Home Networking: Connecting devices like computers, smartphones, smart TVs, and IoT
devices within a home.
Enterprise Networking: Providing wireless access in office buildings, campuses, and large
facilities.
Public Wi-Fi: Offering internet access in public places like cafes, airports, and parks.
IoT (Internet of Things): Connecting smart devices, sensors, and appliances for automation
and remote control.
9. Future Trends
5G and Beyond: The rollout of 5G networks is enabling faster speeds, lower latency, and
new applications like augmented reality (AR), virtual reality (VR), and smart cities.
Wi-Fi 6 and Wi-Fi 7: Wi-Fi 6 (802.11ax) is already providing improved performance in
crowded environments, and Wi-Fi 7 (802.11be) is expected to bring even higher speeds
and efficiency.
IoT Expansion: As more devices become connected, managing and securing wireless IoT
networks will become increasingly important.
Advanced Security: Continued advancements in wireless security protocols to protect
against evolving threats.
Network Security Principles
               Network security principles are the foundational guidelines and practices
designed to protect the integrity, confidentiality, and availability of data and resources within
a network. Implementing these principles is crucial to safeguarding against cyber threats,
unauthorized access, and data breaches. Here are the key network security principles:
1. Confidentiality
    • Definition: Ensures that sensitive information is accessible only to authorized
       individuals and entities.
    • Practices:
           o Encryption: Encrypting data both in transit and at rest to protect it from
               unauthorized access.
           o Access Controls: Implementing strict access control policies to limit who
               can view or modify data.
           o Data Masking: Concealing sensitive data elements (e.g., using asterisks for
               credit card numbers) to prevent exposure.
                                                                                                    2
                                                                                                    8
2. Integrity
    • Definition: Ensures that data remains accurate, consistent, and unaltered during
        storage, transmission, and processing.
    • Practices:
             o Hashing: Using cryptographic hash functions to verify data integrity. If the
                data is altered, the hash value will change.
             o Digital Signatures: Attaching a digital signature to data or messages to
                verify the sender's identity and ensure the content has not been tampered
                with.
             o Checksums: Employing checksums to detect errors in data transmission or
                storage.
3. Availability
    • Definition: Ensures that data and network resources are available to authorized
        users when needed.
    • Practices:
             o Redundancy: Implementing redundant systems (e.g., backup servers,
                multiple data centers) to ensure availability during failures.
             o Load Balancing: Distributing network traffic across multiple servers to
                prevent any single server from becoming overwhelmed.
             o DDoS Protection: Using techniques like rate limiting, traffic filtering, and
                DDoS protection services to defend against Distributed Denial of Service
                (DDoS) attacks.
4. Authentication
    • Definition: Verifies the identity of users, devices, or systems before granting access
        to resources.
    • Practices:
             o Passwords: Using strong, unique passwords and encouraging the use of
                password managers.
             o Multi-Factor Authentication (MFA): Requiring multiple forms of
                authentication (e.g., password + fingerprint, SMS code) to enhance security.
             o Biometric Authentication: Using biological traits (e.g., fingerprints, facial
                recognition) to authenticate users.
5. Authorization
    • Definition: Grants or denies access to resources based on an authenticated user's or
        device's permissions.
    • Practices:
             o Role-Based Access Control (RBAC): Assigning access rights based on the
                user's role within the organization.
             o Least Privilege: Ensuring that users and systems are granted the minimum
                level of access necessary to perform their functions.
             o Access Control Lists (ACLs): Using ACLs to define what actions users or
                systems can perform on specific resources.
6. Accountability
    • Definition: Ensures that actions within a network can be traced back to an
        individual or system.
    • Practices:
             o Logging and Monitoring: Keeping detailed logs of network activity and
                monitoring for suspicious behavior.
             o Audit Trails: Creating audit trails that record who accessed what data, when,
                and from where.
             o Non-Repudiation: Ensuring that users cannot deny their actions by using
                                                                                               2
                                                                                               9
                 methods like digital signatures and robust logging.
7. Non-Repudiation
    • Definition: Ensures that a party in a communication cannot deny the authenticity of
        their signature on a document or a message they sent.
    • Practices:
            o Digital Signatures: Using cryptographic methods to bind a user's identity to
                 their actions or communications.
            o Timestamping: Adding a timestamp to records and transactions to ensure
                 their validity and sequence.
8. Security Policies and Procedures
    • Definition: Establishes rules and guidelines for protecting network resources and
        data.
    • Practices:
            o Security Policy Development: Creating comprehensive security policies that
                 outline acceptable use, access controls, incident response, and more.
            o Regular Audits: Conducting regular security audits to ensure compliance
                 with policies and identify vulnerabilities.
            o Security Training: Educating employees and users on security best
                 practices, potential threats, and how to respond to security incidents.
9. Defense in Depth
    • Definition: A multi-layered approach to security that uses multiple defensive
        strategies to protect against various threats.
    • Practices:
            o Layered Security Controls: Implementing security controls at multiple
                 layers (e.g., network, application, endpoint) to reduce the chances of a
                 successful attack.
            o Firewalls and Intrusion Detection Systems (IDS): Using firewalls to filter
                 incoming and outgoing traffic and IDS to monitor for suspicious activities.
            o Segmentation: Dividing the network into smaller, isolated segments to limit
                 the spread of potential threats.
10. Risk Management
    • Definition: Identifying, assessing, and mitigating risks to the network and its
        resources.
    • Practices:
            o Risk Assessment: Regularly assessing the network for vulnerabilities and
                 potential threats.
            o Threat Modeling: Identifying potential threats and attack vectors to
                 understand the risks they pose.
            o Mitigation Strategies: Implementing measures to reduce risks, such as patch
                 management, security updates, and employee training.
11. Incident Response
    • Definition: Preparing for and responding to security breaches or attacks.
    • Practices:
            o Incident Response Plan: Developing a plan that outlines how to detect,
                 respond to, and recover from security incidents.
            o Forensics: Analyzing security incidents to understand the attack and prevent
                 future occurrences.
            o Communication: Establishing clear communication channels and procedures
                 for reporting and managing incidents.
12. Physical Security
    • Definition: Protecting physical network infrastructure from unauthorized access,
                                                                                               2
                                                                                               10
    damage, or interference.
•   Practices:
       o Access Controls: Restricting physical access to network hardware (e.g.,
            servers, routers) to authorized personnel only.
       o Surveillance: Using cameras and monitoring systems to detect and deter
            unauthorized access.
       o Environmental Controls: Ensuring proper environmental conditions (e.g.,
            temperature, humidity) to prevent hardware failure.
                                                                                   2
                                                                                   11