CN NOTES ILM - Merged PDF
CN NOTES ILM - Merged PDF
CN NOTES ILM - Merged PDF
Networks
Rizwan Naqvi
1
Table of Contents
Chapter1: Emergence of Network , principle of communication Network and Multiplexing...................7
What is computer Network?..................................................................................................................7
Historical Events:................................................................................................................................8
Modes of communication:.....................................................................................................................9
Protocol:..............................................................................................................................................10
Principle of Communication:..............................................................................................................11
Elements of Network:..........................................................................................................................13
Multiplexing:.......................................................................................................................................14
Simplex:..........................................................................................................................................14
Duplex............................................................................................................................................14
Half-duplex.....................................................................................................................................14
Chapter2: Network Topology and Architecture.......................................................................................15
Local Area Network (LAN)................................................................................................................15
MAN:...................................................................................................................................................15
WAN: ..................................................................................................................................................16
LAN Vs WAN.....................................................................................................................................17
Internet:...............................................................................................................................................17
Intranet:...............................................................................................................................................18
Extranet:..............................................................................................................................................19
Ethernet:..............................................................................................................................................19
Physical Topology and Logical Topology:..........................................................................................20
Bus Topology:.....................................................................................................................................21
Ring Topology.....................................................................................................................................21
Mesh Topology:...................................................................................................................................22
Star Topology:.....................................................................................................................................22
Logical Topology:...............................................................................................................................23
Network Architecture:.........................................................................................................................23
Peer-to-Peer Model:........................................................................................................................23
Client-server Model:.......................................................................................................................24
Wireless LAN:.....................................................................................................................................26
Wireless Standards - 802.11b 802.11a 802.11g and 802.11n.........................................................27
Wireless Topologies:.......................................................................................................................27
Chapter3: OSI Reference Model:.............................................................................................................29
Network Software:..............................................................................................................................29
Protocol Hierarchies............................................................................................................................29
Layer Communication:........................................................................................................................29
OSI Model...........................................................................................................................................30
Peer-to-Peer Communication:.............................................................................................................31
Data Encapsulation:.............................................................................................................................31
Seven Layers of OSI Reference Model:..............................................................................................32
1. Physical Layer:...........................................................................................................................32
2. Data Link Layer:.........................................................................................................................32
3. Network Layer:...........................................................................................................................33
The immediate nature of communications over the Internet encourages the formation of global communities.
These communities foster social interaction that is independent of location or time zone.
Examples of Todays popular communication tools.
1. Instant messaging
2. Weblogs
3. wikis
4. Podcasting
5. Collaboration tools
6. Facebook
7. Twitter
Networks Supporting the way we learn
communication, collaboration and engagement are fundamental building blocks of education. institutions are
LAN WAN
Connects host within a relatively small geographical Hosts may be widely dispersed.
area. • Across Campuses
• Same Building • Acorss Cities/countries/continent
• Same room
• Same Campus
Faster Slower
Cheaper Expensive
Under a control of single ownership. Not under a control of a single person.
Typical Speeds: Typical Speed:
10 Mbps to 10Gbps 64 Kbps to 8 Mbps
Historical Events:
• 1948 first commercial computer installed UNIVAC 1
• 1958 First U.S communication satellite.
• 1964 SABRE airline reservation system packet switching network (Proposed by RAND).
• 1969 ARPANET first packet switching network beings operation.
• 1971 frist computer chip
- 4 bit, 2,300 transistors
• 1972 Ethernet specifications forumulated
• 1974 introduces SNA
• 1975 Altair 8800 first commercial micocomputer sold as kit.
• 1975 Paul Allan/Bill Gates wrote a BASIC language interpreter for the Altair, they formed Microsoft.
Modes of communication:
In an IPv4 network, the hosts can communicate one of three different ways:
Unicast - the process of sending a packet from one host to an individual host
Broadcast - the process of sending a packet from one host to all hosts in the network
Multicast - the process of sending a packet from one host to a selected group of hosts
The primary purpose of any network is to provide a method to communicate. All communication methods have
three elements in common. The first of these elements is the message source, or sender. Message sources are
people, or electronic devices, that need to communicate a message to other individuals or devices. The second
element of communication is the destination, or receiver, of the message. The destination receives the message
and interprets it. A third element, called a channel, provides the pathway over which the message can travel
from source to destination.
Protocols are specific to the characteristics of the source, channel and destination of the message. The rules used
to communicate over one medium, like a telephone call, are not necessarily the same as communication using
another medium, such as a letter.
Protocols define the details of how the message is transmitted, and delivered. This includes issues of:
1. Message format
2. Message size
3. Timing
4. Encapsulation
5. Encoding
6. Standard message pattern
Message Format:
Message that is sent over a computer network follows specific format rules for it to be delivered and processed.
Just as a letter is encapsulated in an envelope for delivery, so computer messages are encapsulated. Each
computer message is encapsulated in a specific format, called a frame, before it is sent over the network. A frame
acts like an envelope; it provides the address of the intended destination and the address of the source host.
Message Size:
When a long message is sent from one host to another over a network, it is necessary to break the message into
smaller pieces.
Message Timing:
One factor that affects how well a message is received and understood is timing . People use timing to determine
when to speak, how fast or slow to talk, and how long to wait for a response. These are the rules of engagement.
1. Access Methods
2. Flow Control
3. Response Timeout
Simplex:
A form of communication in which signals are sent in only one direction. This is different from duplex
transmission, in which signals can simultaneously be sent and received by a station, and from half-duplex
transmission, in which signals can be sent or received but not both at the same time. Simplex transmission
occurs in many common communication applications, the most obvious being broadcast and cable television. It
is not used in true network communication because stations on a network generally need to communicate both
ways. Some forms of network communication might seem to be simplex in nature, such as streaming audio or
video, but the communication actually takes place using bidirectional network traffic, usually Transmission
Control Protocol (TCP) traffic. Simplex communication is not included in the V series recommendations of the
International Telecommunication Union (ITU).
Duplex
A telecommunications term referring to bidirectional communication. In full-duplex communication, both
stations send and receive at the same time, and usually two communication channels are required. However, you
can also achieve full-duplex communication using a multiplexing technique whereby signals traveling in
different directions are placed into different time slots. The disadvantage of this technique is that it cuts the
overall possible transmission speed by half.
In half-duplex communication, only one station can transmit at any given time while the other station receives
the transmission. The opposite of duplex communication is simplex communication, which can occur only in
one direction.
Half-duplex
A mode of communication in which data can be transmitted or received, but cannot be transmitted and received
simultaneously. The simplest example is a walkie-talkie: You have to press a button to talk and release the button
to listen. When two people use walkie-talkies to communicate, at any given moment, only one of them can talk
while the other listens. If both try to talk simultaneously, a collision occurs and neither hears what the other says.
Communication through traditional Ethernet networks is another example of half-duplex communication. When
one station on an Ethernet transmits, the other stations detect the carrier signal and listen instead of transmitting.
If two stations transmit signals simultaneously, a collision occurs and both stations stop transmitting and wait
random intervals of time before retransmitting.
In contrast, full-duplex communication enables stations to transmit and receive signals simultaneously, with the
advantage of providing twice the bandwidth of equivalent half-duplex technologies. However, full-duplex
requires two communication channels to achieve these results—one to transmit and one to receive signals.
A third mode of communication is called simplex, which involves transmission in one direction only, with one
station transmitting signals and the other receiving them.
MAN:
is a network that spans a city.
The network consists of various
buildings interconnected via
either wireless or fiber optics
backbones.
A metropolitan area network
(MAN) is a large computer
network that usually spans a city
or a large campus. A MAN
Fig:MAN
Page: 15 compiled by: JP NEC. Daya Ram Budhathoki
usually interconnects a number of local area networks (LANs) using a high-capacity backbone technology, such
as fiber-optical links, and provides up-link services to wide area networks (or WAN) and the Internet.
WAN:
A network that spans broader geographical area than a local area network over public communication network.
WANs interconnect LANs, which then provide access to computers or file servers in other locations. Because
WANs connect user networks over a large geographical area, they make it possible for businesses to
communicate across great distances. WANs allow computers, printers, and other devices on a LAN to be shared
with distant locations. WANs provide instant communications across large geographic areas.
Collaboration software provides access to real-time information and resources and allows meetings to be held
remotely. WANs have created a new class of workers called telecommuters. These people never have to leave
their homes to go to work.
Modems
Integrated Services Digital Network (ISDN)
Digital subscriber line (DSL)
Frame Relay
T1, E1, T3, and E3
Synchronous Optical Network (SONET)
Internet:
The network formed by the co-operative interconnection of a large number of computer networks.
• Network of Networks
• No one owns the Internet
• Every person who makes a connection owns a slice of the Internet.
• There is no central administration of the Internet.
Intranet:
A private TCP/IP internetwork within an organization that uses Internet technologies such as Web servers and
Web browsers for sharing information and collaborating. Intranets can be used to publish company policies and
newsletters, provide sales and marketing staff with product information, provide technical support and tutorials,
and just about anything else you can think of that fits within the standard Web server/Web browser environment.
Intranet Web servers differ from public Web servers in that the public must have the proper permissions and
passwords to access the intranet of an organization. Intranets are designed to permit users who have access
privileges to the internal LAN of the organization. Within an intranet, Web servers are installed in the network.
Browser technology is used as the common front end to access information on servers such as financial,
graphical, or text-based data.
Part of a Company's Intranet that is extended to users outside the company(eg. Normally over the Internet). In
its simplest form, a private TCP/IP network that securely shares information using Hypertext Transfer Protocol
(HTTP) and other Internet protocols with business partners such as vendors, suppliers, and wholesale customers.
An extranet is thus a corporate intranet that is exposed over the Internet to certain specific groups that need
access to it. Extranets built in this fashion follow the client/server paradigm, with Web servers such as Apache.
Extranets are a powerful tool because they let businesses share resources on their own private networks over the
Internet with suppliers, vendors, business partners, or customers. Extranets are typically used for supporting real-
time supply chains, for enabling business partners to work together, or to share information such as catalogs with
customers. The power of the extranet is that it leverages the existing technology of the Internet to increase the
power, flexibility, and competitiveness of businesses utilizing well-known and easily used tools such as Web
servers and Web browsers. Extranets also save companies money by allowing them to establish business-to-
business connectivity over the Internet instead of using expensive, dedicated leased lines. Extranets can also save
money by reducing phone and fax costs.
Ethernet:
Ethernet is a family of LAN technologies,that may be best understood with the OSI reference model.
Advantages:
• Easy to install
• Costs are usually low
• Easy to add systems to network
• Great for small networks
Disadvantages:
• out of date technology.
• include difficult reconnection and fault isolation
• Can be difficult to troubleshoot.
• Unmanageable in a large network
• If cable breaks, whole network is down
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.
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 requires changing only two connections. The only constraints
are media and traffic considerations (maximum ring length and number of devices). 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.
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.
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.
Advantages:
• Very orderly network where every device has access to the token and the opportunity to transmit
• Performs better than a bus topology under heavy network load
• Does not require network server to manage the connectivity between the computers
Mesh Topology:
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 connect n nodes in Mesh
topology, we require n(n-1)/2 duplex mode links.
Advantages:
1. The use of dedicated links guarantees that each connection can carry its own data load, thus eliminating
the traffic problems that can occur when links must be shared by multiple devices.
2. Robust, If one link becomes unusable, it does not incapacitate the entire system.
3. Advantage of privacy or security.
4. point-to-point links make fault identification and fault isolation easy , Traffic can be routed to avoid
links with suspected problems.
Disadvantage:
1. Required high amount of cabling and the number of I/O ports.
2. 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.
One practical example of a mesh topology is the connection of telephone regional offices in which each regional
office needs to be connected to every other regional office.
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:
• Less Expensive than Mesh topology.
• In a star topology, each device needs only one link and one I/O port to connect it to any number of other
devices. This factor also makes it easy to install and reconfigure.
• Less Cabling, Addition and Deletion involves only one connection between the devices and the Hub or
Switch.
• Easy for Fault identification and fault isolation. If one link fails, only that link is affected. All
• other links remain active.
An extended star topology links individual stars together by connecting the hubs or switches.
A hierarchical topology is similar to an extended star. However, instead of linking the hubs or switches
together, the system is linked to a computer that controls the traffic on the topology.
Logical Topology:
The logical topology of a network determines how the hosts communicate across the medium. The two most
common types of logical topologies are broadcast and token passing.
The use of a broadcast topology indicates that each host sends its data to all other hosts on the network
medium. There is no order that the stations must follow to use the network. It is first come, first serve. Ethernet
works this way as will be explained later in the course.
The second logical topology is token passing. In this type of topology, an electronic token is passed sequentially
to each host. When a host receives the token, that host can send data on the network. If the host has no data to
send, it passes the token to the next host and the process repeats itself. Two examples of networks that use token
passing are Token Ring and Fiber Distributed Data Interface (FDDI). A variation of Token Ring and FDDI is
Arcnet. Arcnet is token passing on a bus topology.
Network Architecture:
Two types of Network Architecture:
1. Peer-to-Peer Model
2. Client-server Model
Peer-to-Peer Model:
In a peer-to-peer network, networked computers act as equal partners, or peers. As peers, each computer can take
on the client function or the server function. Computer A may request for a file from Computer B, which then
sends the file to Computer A. Computer A acts like the client and Computer B acts like the server. At a later time,
Computers A and B can reverse roles.
In a peer-to-peer network, individual users control their own resources. The users may decide to share certain
files with other users. The users may also require passwords before they allow others to access their resources.
Since individual users make these decisions, there is no central point of control or administration in the network.
In addition, individual users must back up their own systems to be able to recover from data loss in case of
As networks grow, peer-to-peer relationships become increasingly difficult to coordinate. A peer-to-peer network
works well with ten or fewer computers. Since peer-to-peer networks do not scale well, their efficiency
decreases rapidly as the number of computers on the network increases. Also, individual users control access to
the resources on their computers, which means security may be difficult to maintain. The client/server model of
networking can be used to overcome the limitations of the peer-to-peer network.
Peer-to-peer networks are relatively easy to install and operate. No additional equipment is necessary beyond a
suitable operating system installed on each computer. Since users control their own resources, no dedicated
administrators are needed.
Client-server Model:
The term client-server refers to a popular model for computer networking that utilizes client and server devices
each designed for specific purposes. The client-server model can be used on the Internet as well as local area
networks (LANs). Examples of client-server systems on the Internet include Web browsers and Web servers,
FTP clients and servers, and DNS.
In a client/server arrangement, network services are located on a dedicated computer called a server. The server
responds to the requests of clients. The server is a central computer that is continuously available to respond to
requests from clients for file, print, application, and other services. Most network operating systems adopt the
form of a client/server relationship. Typically, desktop computers function as clients and one or more computers
with additional processing power, memory, and specialized software function as servers.
Servers are designed to handle requests from many clients simultaneously. Before a client can access the server
resources, the client must be identified and be authorized to use the resource. Each client is assigned an account
The centralized functions in a client/server network has substantial advantages and some disadvantages.
Although a centralized server enhances security, ease of access, and control, it introduces a single point of failure
into the network. Without an operational server, the network cannot function at all. Servers require a trained,
expert staff member to administer and maintain. Server systems also require additional hardware and specialized
software that add to the cost.
Client/server describes the relationship between two computer programs in which one program, the client, makes
a service request from another program, the server, which fulfill the request. Although programs within a single
computer can use the client/server idea, it is a more important idea in a network. In a network, the client/server
model provides a convenient way to interconnect programs that are distributed efficiently across different
locations. Computer transactions using the client/server model are very common. For example, to check your
bank account from your computer, a client program in your computer forwards your request to a server program
at the bank. That program might in turn forward the request to its own client program that sends a request to a
database server at another bank computer to retrieve your account balance. The balance is returned back to the
bank data client, which in turn serves it back to the client in your personal computer, which displays the
information for you.
Advantages:Flexibility of the system, scalability, cost saving, centralized control and implementation of
business rules, increase of developers productivity, portability, improved network and resource utilization.
These days People are becoming more mobile and want to maintain access to their business LAN resources from
locations other than their desks. Workers in the office want to take their laptops to meetings or to a co-worker's
office. When using a laptop in another location, it is inconvenient to rely on a wired connection.
WLAN VS LAN:
• RF does not have boundaries, such as the limits of a wire in a sheath. The lack of such a boundary
allows data frames traveling over the RF media to be available to anyone that can receive the RF signal.
• RF is unprotected from outside signals, whereas cable is in an insulating sheath. Radios operating
independently in the same geographic area but using the same or a similar RF can interfere with each
other.
• RF transmission is subject to the same challenges inherent in any wave-based technology, such as
consumer radio. For example, as you get further away from the source, you may hear stations playing
over each other or hear static in the transmission. Eventually you may lose the signal all together. Wired
LANs have cables that are of an appropriate length to maintain signal strength.
• RF bands are regulated differently in various countries. The use of WLANs is subject to additional
regulations and sets of standards that are not applied to wired LANs.
802.11b:
• Pros of 802.11b - lowest cost; signal range is good and not easily obstructed
• Cons of 802.11b - slowest maximum speed; home appliances may interfere on the unregulated
frequency band
802.11g:
• Pros of 802.11g - fast maximum speed; signal range is good and not easily obstructed
• Cons of 802.11g - costs more than 802.11b; appliances may interfere on the unregulated signal
frequency.
802.11n:
• Pros of 802.11n - fastest maximum speed and best signal range; more resistant to signal interference
from outside sources
• Cons of 802.11n - standard is not yet finalized; costs more than 802.11g; the use of multiple signals may
greatly interfere with nearby 802.11b/g based networks.
Wireless Topologies:
1. BSS (Basic Service Set). (in the presence of a Control Module often called “Base Station” or Access
points.
2. Ad-hoc or Peer-to-Peer (When there is no Control Module)
Ad-Hoc:
Wireless networks can operate without access points; this is called an ad hoc topology. Client stations which are
configured to operate in ad hoc mode configure the wireless parameters between themselves. The IEEE 802.11
standard refers to an ad hoc network as an independent BSS (IBSS).
Network Software:
Network Software is a set of primitives that define the protocol between two machines. The network software
resolves an ambiguity among different types of network making it possible for all the machines in the network to
connect and communicate with one another and share information.
network software is the information, data or programming used to make it possible for computers to
communicate or connect to one another.
Network software is used to efficiently share information among computers. It encloses the information to be
sent in a “package” that contains a “header” and a “trailer”. The header and trailer contain information for the
receiving computer, such as the address of that computer and how the information package is coded. Information
is transferred between computers as either electrical signals in electric wires, as light signals in fiber-optic
cables, or as electromagnetic waves through space.
Protocol Hierarchies
To reduce their design complexity, most networks are organized as a stack of layers or levels, each one built
upon the one below it. The number of layers, the name of each layer, the contents of each layer, and the function
of each layer differ from network to network. The purpose of each layer is to offer certain services to the higher
layers, shielding those layers from the details of how the offered services are actually implemented. In a sense,
each layer is a kind of virtual machine, offering certain services to the layer above it.
This concept is actually a familiar one and used
throughout computer science, where it is variously
known as information hiding, abstract data types, data
encapsulation, and object-oriented programming. The
fundamental idea is that a particular piece of software
(or hardware) provides a service to its users but keeps
the details of its internal state and algorithms hidden
from them.
Layer n on one machine carries on a conversation with
layer n on another machine. The rules and conventions
used in this conversation are collectively known as the
layer n protocol. Basically, a protocol is an agreement
between the communicating parties on how communication is to proceed. As an analogy, when a woman is
introduced to a man, she may choose to stick out her hand. He, in turn, may decide either to shake it or kiss it,
depending, for example, on whether she is an American lawyer at a business meeting or a European princess at a
formal ball. Violating the protocol will make communication more difficult, if not completely impossible.
Layer Communication:
In order for data packets to travel from a source to a destination on a network, it is important that all the devices
on the network speak the same language or protocol. A protocol is a set of rules that make communication on a
network more efficient. For example, while flying an airplane, pilots obey very specific rules for communication
with other airplanes and with air traffic control.
OSI Model
An architectural model for open networking systems that was developed by the International Organization for
Standardization (ISO) in Europe in 1974. The Open Systems Interconnection (OSI) reference model was
intended as a basis for developing universally accepted networking protocols, but this initiative essentially failed
for the following reasons.
• The standards process was relatively closed compared with the open standards process used by the
Internet Engineering Task Force (IETF) to develop the TCP/IP protocol suite.
• The model was overly complex. Some functions (such as connectionless communication) were
neglected, while others (such as error correction and flow control) were repeated at several layers.
• The growth of the Internet and TCP/IP—a simpler, real-world protocol model—pushed the OSI
reference model out.
The OSI reference model is best seen as an idealized model of the logical connections that must occur in order
for network communication to take place. Most protocol suites used in the real world, such as TCP/IP, DECnet,
and Systems Network Architecture (SNA), map somewhat loosely to the OSI reference model. The OSI model is a
good starting point for understanding how various protocols within a protocol suite function and interact.
Data packets on a network originate at a source and then travel to a destination. Each layer depends on the
service function of the OSI layer below it. To provide this service, the lower layer uses encapsulation to put the
PDU from the upper layer into its data field. Then it adds whatever headers and trailers the layer needs to
perform its function. Next, as the data moves down through the layers of the OSI model, additional headers and
trailers are added.
Data Encapsulation:
All communications on a network originate at a source, and are sent to a destination. The information sent on a
network is referred to as data or data packets. If one computer (host A) wants to send data to another computer
(host B), the data must first be packaged through a process called encapsulation.
Encapsulation wraps data with the necessary protocol information before network transit. Therefore, as the data
packet moves down through the layers of the OSI model, it receives headers, trailers, and other information.
Mechanical. Relates to the physical properties of the interface to a transmission medium. Typically, the
specification is of a pluggable connector that joins one or more signal conductors, called circuits.
Electrical. Relates to the representation of bits (e.g., in terms of voltage levels) and the data transmission rate of
bits. It defines the voltage, current, modulation, bit synchronization, connection activation and deactivation, and
various electrical characteristics for the transmission media (such as unshielded or shielded twisted-pair cabling,
coaxial cabling, and fiber-optic cabling).
Functional. Specifies the functions performed by individual circuits of the physical interface between a system
and the transmission medium.
Procedural. Specifies the sequence of events by which bit streams are exchanged across the physical medium.
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 and/or receiver of the frame. If the frame is intended for a system
outside the sender's network, the receiver address is the address of the device that connects the network to the
next one.
Error control. The data link layer adds reliability to the physical layer by adding mechanisms to detect and
retransmit damaged or lost frames. It also uses a mechanism to recognize duplicate frames. Error control is
normally achieved through a trailer added to the end of the frame.
Access control. When two or more devices are connected to the same link, data link layer protocols are
necessary to determine which device has control over the link at any given time
Examples of data-link protocols for local area networking include the following:
• IEEE 802.3, which provides the Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
access method for baseband Ethernet networks
• IEEE 802.5, which provides the token-passing access method for baseband token ring implementations
For WANs, data-link layer protocols encapsulate LAN traffic into frames suitable for transmission over WAN
links. Common data-link encapsulation methods for WAN transmission include the following:
• Point-to-point technologies such as Point-to-Point Protocol (PPP) and High-level Data Link Control
(HDLC) protocol
• Multipoint technologies such as frame relay, Asynchronous Transfer Mode (ATM), Switched
Multimegabit Data Services (SMDS), and X.25
3. Network Layer:
Layer 3 of the Open Systems Interconnection (OSI) reference model for networking. The network layer is
responsible for functions such as the following:
• Logical addressing and routing of packets over the network
• Establishing and releasing connections and paths between two nodes on a network
• Transferring data, generating and confirming receipts, and resetting connections
The network layer also supplies connectionless and connection-oriented services to the transport layer above it.
The network layer functions closely with the physical layer (layer 1) and data-link layer (layer 2) in most real-
world network protocol implementations.
On TCP/IP-based networks, IP addresses and network numbers are used at the network layer, and IP routers
perform their routing functions at this layer. An example of an OSI model network layer protocol is the X.25
packet-switching network layer protocol, which is built on the X.21 physical layer protocol.
4. Transport Layer:
Layer 4 of the Open Systems Interconnection (OSI) reference model. The transport layer is responsible for
providing reliable transport services to the upper-layer protocols. These services include the following:
• Flow control to ensure that the transmitting device does not send more data than the receiving device can
handle.
A connection between two devices that acts as though it's a direct connection even though it may physically be
circuitous. The term is used most frequently to describe connections between two hosts in a packet-switching
network. In this case, the two hosts can communicate as though they have a dedicated connection even though
the packets might actually travel very different routes before arriving at their destination. An X.25 connection is
an example of a virtual circuit.
Virtual circuits can be either permanent (called PVCs) or temporary (called SVCs).
5. Session Layer:
Layer 5 of the Open Systems Interconnection (OSI) reference model, which enables sessions between computers
on a network to be established and terminated. The session layer does not concern itself with issues such as the
reliability and efficiency of data transfer between stations because these functions are provided by the first four
layers of the OSI reference model.
Functions:
Dialog control: The session layer allows two systems to enter into a dialog. It allows 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.
Synchronization: The session layer allows a process to add 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 checkpoints after every
100 pages to ensure that each 100-page unit is received and acknowledged independently. In this case, if a crash
happens during the transmission of page 523, the only pages that need to be resent after system recovery are
pages 501 to 523. Pages previous to 501 need
not be resent.
6. Presentation Layer:
The presentation layer is concerned with the syntax and semantics of the information exchanged between two
systems .
Specific responsibilities of the presentation layer include the following:
Translation. The processes (running programs) in two systems are usually exchanging information in the form
of character strings, numbers, and so on. The information must be changed to bit streams before being
transmitted. Because different computers use different encoding systems, the presentation layer is responsible for
interoperability between these different encoding methods. The presentation layer at the sender changes the
information from its sender-dependent format into a common format. The presentation layer at the receiving
machine changes the common format into its receiver-dependent format.
Encryption. To carry sensitive information, a system must be able to ensure privacy. 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.
Compression. Data compression reduces the number of bits contained in the information. Data compression
7. Application layer:
Layer 7 of the Open Systems Interconnection (OSI) reference model, in which network-aware, user-controlled
software is implemented—for example, e-mail, file transfer utilities, and terminal access. The application layer
represents the window between the user and the network. Examples of protocols that run at the application layer
include File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), telnet, and similar protocols that can
be implemented as utilities the user can interface with.
File transfer, access, and management. This application allows a user to access files in a remote host (to make
changes or read data), to retrieve files from a remote computer for use in the local computer, and to manage or
control files in a remote computer locally.
Mail services. This application provides the basis for e-mail forwarding and storage.
Directory services. This application provides distributed database sources and access for global information
about various objects and services.
Summary:
Physical Layer: How to transmit bits.
Data Link Layer: How to transmits frames
Network: How to route packets to the node.
Transport: How to send packets to the applications.
Session: Manage connections.
Presentation: Encode/Decode messages, security.
Application: Everything else.
Twisted Pair Cable; Co-axial Cable; Base – band Cable; Broad – band Cable; Fiber Optics; Wireless
Networking; Physical Layer Devices ( Hub, Repeaters); Introduction of Frame Relay, ATM, ISDN, PSTN and
X.25.
Transmission Medium:
A transmission medium can be broadly defined as anything that can carry information from a source to a
destination. For example, the transmission medium for two people having a dinner conversation is the air. The
air can also be used to convey the message in a smoke signal or semaphore. For a written message, the
transmission medium might be a mail carrier, a truck, or an airplane.
In data communications the definition of the information and the transmission medium is more specific. The
transmission medium is usually free space, metallic cable, or fiber-optic cable. The information is usually a
signal that is the result of a conversion of data from another form.
Guided Media:
Guided media, which are those that provide a conduit from one device to another, include twisted-pair cable,
coaxial cable, and fiber-optic cable. A signal traveling along any of these media is directed and contained by the
physical limits of the medium. Twisted-pair and coaxial cable use metallic (copper) conductors that accept and
transport signals in the form of electric current. Optical fiber is a cable that accepts and transports signals in the
form of light.
The twisting has the effect of canceling unwanted signals. When two wires in an electrical circuit are placed
close together, external electromagnetic fields create the same interference in each wire. The pairs are twisted to
keep the wires in as close proximity as is physically possible. When this common interference is present on the
wires in a twisted pair, the receiver processes it in equal yet opposite ways. As a result, the signals caused by
electromagnetic interference from external sources are effectively cancelled.
This cancellation effect also
helps avoid interference from
internal sources called
crosstalk. Crosstalk is the
interference caused by the
magnetic field around the
adjacent pairs of wires in the
cable. When electrical current
flows through a wire, it
creates a circular magnetic
field around the wire. With
the current flowing in
opposite directions in the two
wires in a pair, the magnetic
fields - as equal but opposite
forces - have a cancellation
effect on each other.
Additionally, the different
pairs of wires that are twisted
in the cable use a different number of twists per meter to help protect the cable from crosstalk between pairs.
The electrical characteristics of copper cabling are defined by the Institute of Electrical and Electronics
Engineers (IEEE). IEEE rates UTP cabling according to its performance. Cables are placed into categories
according to their ability to carry higher bandwidth rates. For example, Category 5 (Cat5) cable is used
commonly in 100BASE-TX FastEthernet installations. Other categories include Enhanced Category 5 (Cat5e)
cable and Category 6 (Cat6).
Cables in higher categories are designed and constructed to support higher data rates. As new gigabit speed
Ethernet technologies are being developed and adopted, Cat5e is now the minimally acceptable cable type, with
Cat6 being the recommended type for new building installations.
Co-axial Cable:
Coaxial cable (or coax) carries signals of higher frequency ranges than those in twisted-pair cable, in part
because the two media are constructed quite differently. Instead of having two wires, coax has a central core
conductor of solid or stranded wire (usually copper) enclosed in an insulating sheath, which is, in turn, encased
in an outer conductor of metal foil, braid, or a combination of the two. The outer metallic wrapping serves both
as a shield against noise and as the second conductor, which completes the circuit. This outer conductor is also
enclosed in an insulating sheath, and the whole cable is protected by a plastic cover
All the elements of the coaxial cable encircle the center conductor. Because they all share the same axis, this
construction is called coaxial, or coax for short.
Uses of Coaxial Cable
The coaxial cable design has been adapted for different purposes. Coax is an important type of cable that is used
in wireless and cable access technologies. Coax cables are used to attach antennas to wireless devices. The
coaxial cable carries radio frequency (RF) energy between the antennas and the radio equipment.
Cable service providers are currently converting their one-way systems to two-way systems to provide Internet
connectivity to their customers. To provide these services, portions of the coaxial cable and supporting
amplification elements are replaced with multi-fiber-optic cable. However, the final connection to the customer's
location and the wiring inside the customer's premises is still coax cable. This combined use of fiber and coax is
referred to as hybrid fiber coax (HFC).
In the past, coaxial cable was used in Ethernet installations. Today UTP offers lower costs and higher bandwidth
than coaxial and has replaced it as the standard for all Ethernet installations.
Fiber-optics
Fiber-optic cabling uses either glass or plastic fibers to guide light impulses from source to destination. The bits
are encoded on the fiber as light impulses. Optical fiber cabling is capable of very large raw data bandwidth
rates. Most current transmission standards have yet to approach the potential bandwidth of this media.
Principle of Fiber-optics:
It is based on the principle of Total internal Reflection.
Optical fibers use reflection to guide light through a channel. A glass or plastic core is surrounded by a cladding
of less dense glass or plastic. The difference in density of the two materials must be such that a beam of light
moving through the core is reflected off the cladding instead of being refracted into it as shown in fig below.
Propagation modes:
Current technology supports two modes (multimode and single mode) for propagating light along optical
channels, each requiring fiber with different physical characteristics. Multi- mode can be implemented in two
forms: step-index or graded-index .
Single-mode uses step-index fiber and a highly focused source of light that limits beams to a small range of
angles, all close to the horizontal. The single- mode fiber itself is manufactured with a much smaller diameter
than that of multimode fiber, and with substantiallY lower density (index of refraction). The decrease in density
results in a critical angle that is close enough to 90° to make the propagation of beams almost horizontal. In this
case, propagation of different beams is almost identical, and delays are negligible. All the beams arrive at the
destination "together" and can be recombined with little distortion to the signal
Multimode fiber typically uses LED emitters that do not create a single coherent light wave. Instead, light from
an LED enters the multimode fiber at different angles. Because light entering the fiber at different angles takes
different amounts of time to travel down the fiber, long fiber runs may result in the pulses becoming blurred on
reception at the receiving end. This effect, known as modal dispersion, limits the length of multimode fiber
segments.
Multimode Step-index:
In multimode step-index fiber, the density of the core remains constant from the center to the edges. A beam of
light moves through this constant density in a straight line until it reaches the interface of the core and the
cladding. At the interface, there is an abrupt change due to a lower density; this alters the angle of the beam's
motion. The term step index refers to the suddenness of this change, which contributes to the distortion of the
signal as it passes through the fiber .
• Higher bandwidth. Fiber-optic cable can support dramatically higher bandwidths (and hence data rates)
than either twisted-pair or coaxial cable. Currently, data rates and bandwidth utilization over fiber-optic
cable are limited not by the medium but by the signal generation and reception technology available.
• Less signal attenuation. Fiber-optic transmission distance is significantly greater than that of other
guided media. A signal can run for 50 km without requiring regeneration. We need repeaters every 5 km
for coaxial or twisted-pair cable.
• Resistance to corrosive materials. Glass is more resistant to corrosive materials than copper.
• Light weight. Fiber-optic cables are much lighter than copper cables.
• Greater immunity to tapping. Fiber-optic cables are more immune to tapping than copper cables.
Copper cables create antenna effects that can easily be tapped.
• Installation and maintenance. Fiber-optic cable is a relatively new technology. Its installation and
maintenance require expertise that is not yet available everywhere.
• Cost. The cable and the interfaces are relatively more expensive than those of other guided media. If the
demand for bandwidth is not high, often the use of optical fiber cannot be justified.
Wireless Networking
Unguided media transport electromagnetic waves without using a physical conductor. This type of
communication is often referred to as wireless communication. Signals are normally broadcast through free
space and thus are available to anyone who has a device capable of receiving them.
Fig:Bands
This characteristic can be both an advantage and a disadvantage. It is an advantage because, for example, an AM
radio can receive signals inside a building. It is a disadvantage because we cannot isolate a communication to
just inside or outside a building. The radio wave band is relatively narrow, just under 1 GHz, compared to the
microwave band. When this band is divided into subbands, the subbands are also narrow, leading to allow data
rate for digital communications.
Omnidirectional Antenna
Radio waves use omnidirectional antennas that send out signals in all directions. Based on the wavelength,
strength, and the purpose of transmission, we can have several types of antennas. Figure 7.20 shows an
omnidirectional antenna.
Applications
The omnidirectional characteristics of radio waves make them useful for multicasting, in which there is one
sender but many receivers. AM and FM radio, television, maritime radio, cordless phones, and paging are
examples of multicasting.
Microwaves
Electromagnetic waves having frequencies between 1 and 300 GHz are called microwaves. Microwaves are
unidirectional. When an antenna transmits microwave waves, they can be narrowly focused. This means that the
sending and receiving antennas need to be aligned. The unidirectional property has an obvious advantage. A pair
of antennas can be aligned without interfering with another pair of aligned antennas. The following describes
some characteristics of microwave propagation:
• Microwave propagation is line-of-sight. Since the towers with the mounted antennas need to be in direct
sight of each other, towers that are far apart need to be very tall. The curvature of the earth as well as
other blocking obstacles do not allow two short towers to communicate by using microwaves. Repeaters
are often needed for long- distance communication.
• Very high-frequency microwaves cannot penetrate walls. This characteristic can be a disadvantage if
receivers are inside buildings.
• The microwave band is relatively wide, almost 299 GHz. Therefore wider subbands can be assigned, and
a high data rate is possible
• Use of certain portions of the band requires permission from authorities.
Unidirectional Antenna
Microwaves need unidirectional antennas that send out signals in one direction. Two types of antennas are used
for microwave communications: the parabolic dish and the horn .
A parabolic dish antenna is based on the geometry of a parabola: Every line parallel to the line of symmetry (line
of sight) reflects off the curve at angles such that all the lines intersect in a common point called the focus. The
parabolic dish works as a funnel, catching a wide range of waves and directing them to a common point. In this
way, more of the signal is recovered than would be possible with a single-point receiver.
A horn antenna looks like a gigantic scoop. Outgoing transmissions are broadcast up a stem (resembling a
handle) and deflected outward in a series of narrow parallel beams by the curved head. Received transmissions
are collected by the scooped shape of the horn, in a manner similar to the parabolic dish, and are deflected down
into the stem.
Infrared
Infrared waves, with frequencies from 300 GHz to 400 THz (wavelengths from 1 mm to 770 nm), can be used
for short-range communication. Infrared waves, having high frequencies, cannot penetrate walls. This
advantageous characteristic prevents interference between one system and another; a short-range communication
system in one room cannot be affected by another system in the next room. When we use our infrared remote
control, we do not interfere with the use of the remote by our neighbors. However, this same characteristic
makes infrared signals useless for long-range communication. In addition, we cannot use infrared waves outside
a building because the sun's rays contain infrared waves that can interfere with the communication.
Applications
The infrared band, almost 400 THz, has an excellent potential for data transmission. Such a wide bandwidth can
be used to transmit digital data with a very high data rate. The Infrared Data Association (IrDA), an association
for sponsoring the use of infrared waves, has established standards for using these signals for communication
between devices such as keyboards, mice, PCs, and printers. For example, some manufacturers provide a special
Infrared signals can be used for short-range communication in a closed area using line-of-sight propagation.
Satellite Microwave:
• Uses satellite in geostationary (geosynchronous) orbit ( 36,000 km).
• Source transmits signal to satellite which amplifies or repeats it,and retransmits down to destinations.
• Optimum transmission in 1 - 10 GHz range; Bandwidth of 100’sMHz.
• Significant propagation delay 270ms.
• Total propagation delay is independent of distance between sender and receiver.
• Applications:
– Long-distance telephones.
– Television distribution
– Private business networks.
Repeater
A networking component that extends a network by boosting the signal so that it can travel farther along the
cabling.
How It Works
Digital signals traveling on cables weaken with distance—a phenomenon known as attenuation. A repeater is a
form of digital amplifier that works at the physical layer (layer 1) of the Open Systems Interconnection (OSI)
reference model for networking to regenerate (amplify) the signal so that it can travel farther. Repeaters also
perform other functions such as filtering out noise caused by electromagnetic interference (EMI), reshaping the
signal, and correcting timing to remove signal jitter so that the signal can travel farther. Repeaters can also be
used to join dissimilar media such as unshielded twisted-pair (UTP) cabling and thinnet, but they cannot be used
to join dissimilar network architectures such as Ethernet and Token Ring. Repeaters are an inexpensive way to
extend a network.
Repeaters can be used in Ethernet and Token Ring local area networks (LANs) to extend signal transmission to
remote nodes and over long fiber-optic cabling runs to connect LANs. Repeaters can also be used in mainframe
environments for boosting signals for serial transmission to remote terminals.
Other uses for repeaters include the following:
• Joining two 16-Mbps Token Ring networks in different buildings over distances up to 3000 meters over
multimode fiber-optic cabling or up to 20 kilometers over single-mode fiber
• Increasing the lobe length between a Token Ring main ring and a remote node
• Joining dissimilar 10Base2 and 10Base5 segments to form a single Ethernet LAN
• Boosting signals from mainframe controllers to 3270 terminals over coaxial or UTP cabling to support
distances up to 2500 meters
• Extending the operating distance of T1 lines by placing G.703 repeaters at 2.2-kilometer intervals
• Extending backbone fiber-optic cable runs in campuswide LANs or metropolitan area networks (MANs)
Repeaters are also used in fiber-optic networks to amplify and regenerate light signals for long-distance cable
runs. Repeaters come in various types for different network architectures and data communication technologies.
Multiple Access
The upper sublayer of Datalink layer, that is responsible for flow and error control is called the logical link
control (LLC) layer; the lower sublayer that is mostly responsible for multiple- access resolution is called the
media access control (MAC) layer.
According to CSMA/CD, a node should not send a packet unless the network is clear of traffic. If two nodes
send packets at the same time, a collision occurs and the packets are lost. Then both nodes send a jam signal,
wait for a random amount of time, and retransmit their packets. Any part of the network where packets from two
or more nodes can interfere with each other is considered a collision domain. A network with a larger number of
nodes on the same segment has a larger collision domain and typically has more traffic. As the amount of traffic
in the network increases, the likelihood of collisions increases.
CSMA/CD Algorithm:
1. If the medium is idle, transmit; otherwise, go to step 2.
2. If the medium is busy, continue to listen until the channel is idle, then transmit immediately.
3. If a collision is detected during transmission, transmit a brief jamming signal to assure that all stations
know that there has been a collision and then cease transmission.
4. After transmitting the jamming signal, wait a random amount of time, then attempt to transmit again.
(Repeat from step 1.
Traditional Ethernet uses CSMA/CD.
Bridge:
A networking component used either to extend or to segment networks. Bridges work at the OSI data-link layer.
They can be used both to join dissimilar media such as unshielded twisted-pair (UTP) cabling and fiber-optic
cabling, and to join different network architectures such as Token Ring and Ethernet. Bridges regenerate signals
How it works?
Bridges operate by sensing the source MAC addresses of the transmitting nodes on the network and
automatically building an internal routing table. This table is used to determine which connected segment to
route packets to, and it provides the filtering capability that bridges are known for. If the bridge knows which
segment a packet is intended for, it forwards the packet directly to that segment. If the bridge doesn’t recognize
the packet’s destination address, it forwards the packet to all connected segments except the one it originated on.
And if the destination address is in the same segment as the source address, the bridge drops the packet. Bridges
also forward broadcast packets to all segments except the originating one.
Hub:
The basic networking component used in traditional 10-Mbps Ethernet networks to connect network
stations to form a local area network (LAN). Hubs can be used for
• Connecting about a dozen computers to form a workgroup or departmental LAN
• Connecting other hubs in a cascaded star topology to form a larger LAN of up to roughly a hundred
computers
How It Works
Hubs are the foundation of traditional 10BaseT
Ethernet networks. The hub receives signals
from each station and repeats the signals to all
other stations connected to the hub. In active
hubs (which all of today’s hubs are), the signal
received from one port is regenerated
(amplified) and retransmitted to the other ports
on the hub. Hubs thus perform the function of a
repeater and are sometimes called multiport
repeaters. From a logical cabling point of view,
stations wired into a hub form a star topology.
Hubs generally have RJ-45 ports for unshielded
twisted-pair (UTP) cabling, and they range in
size from 4 to 24 or more ports for connecting
stations to the hub, plus one or more uplink
ports for connecting the hub to other hubs in a
cascaded star topology. Hubs generally have various light-emitting diode (LED) indicator lights to indicate the
status of each port, link status, collisions, and so on.
Switch:
Switch is essentially a multi-port bridge. Switches allow the segmentation of the LAN into separate collision
domains. Each port of the switch represents a separate collision domain and provides the full media bandwidth
to the node or nodes connected on that port. With fewer nodes in each collision domain, there is an increase in
the average bandwidth available to each node, and collisions are reduced.
Hub VS Switch:
Hub Switch
Works on physical layer Works on Datalink layer
Half-duplex Full Duplex
Hub extends the collision domain Switch splits the collision domain (Each
port of the switch acts as a collision
domain)
Multiport Repeater Multiport Bridge
Overall Bandwidth is shared Each port receives its own bandwidth.
Framing:
The data link layer, needs to pack bits into frames, so that each frame is distinguishable from another. The Data
Link layer prepares a packet for transport across the local media by encapsulating it with a header and a trailer to
create a frame.
Fixed-Size Framing
Frames can be of fixed or variable size. In fixed-size framing, there is no need for defining the boundaries of the
frames; the size itself can be used as a delimiter. An example of this type of framing is the ATM wide-area
network, which uses frames of fixed size called cells.
Variable-Size Framing
variable-size framing is prevalent in local- area networks. In variable-size framing, we need a way to define the
end of the frame and the beginning of the next. Historically, two approaches were used for this purpose: a
character-oriented approach and a bit-oriented approach.
Character-Oriented Protocols
In a character-oriented protocol, data to be carried are 8-bit characters from a coding system such as ASCII (see
Appendix A). The header, which normally carries the source and destination addresses and other control
information, and the trailer, which carries error detection or error correction redundant bits, are also multiples of
8 bits. To separate one frame from the next, an 8-bit (I-byte) flag is added at the beginning and the end of a
frame. The flag, composed of protocol-dependent special characters, signals the start or end of a frame .
Any pattern used for the flag could also be part of the information. To fix this problem, a byte-stuffing strategy
was added to character-oriented framing. In byte stuffing (or character stuffing), a special byte is added to the
data section of the frame when there is a character with the same pattern as the flag. The data section is stuffed
with an extra byte. This byte is usually called the escape character (ESC), which has a predefined bit pattern.
Whenever the receiver encounters the ESC character, it removes it from the data section and treats the next
character as data, not a delimiting flag.
Character-oriented protocols present a problem in data communications. The universal coding systems in use
today, such as Unicode, have 16-bit and 32-bit characters that conflict with 8-bit characters. We can say that in
general, the tendency is moving toward the bit-oriented protocols that we discuss next.
Bit-Oriented Protocols
In a bit-oriented protocol, the data section of a frame is a sequence of bits to be interpreted by the upper layer as
text, graphic, audio, video, and so on. However, in addition to headers (and possible trailers), we still need a
delimiter to separate one frame from the other. Most protocols use a special 8-bit pattern flag 01111110 as the
delimiter to define the beginning and the end of the frame.
LAN
Architecture:
The architecture of a LAN can be considered as a set of layered protocols.
In OSI terms, the higher layer protocols are totally independent of the LAN architecture. Hence, only lower
order layers are considered for the design of LAN architecture.
The datalink layer of LAN is split into two sub layers.
- Medium Access Control (MAC),
- Logical Link Control Layer (LLC).
The IEEE 802 committee had formulated the standards for LAN.
Destination Service Access Point (DSAP) -- IEEE 802.2 header begins with a 1 byte field, which identifies the
receiving upper-layer process.
Source Service Access Point (SSAP) -- Following the DSAP address is the 1-byte address, which identifies the
sending upper-layer process.
Control -- The Control field employs three different formats, depending on the type of LLC frame used:
• Information (I) frame -- Carries upper-layer information and some control information.
• Supervisory (S) frame -- Provides control information. An S frame can request and suspend
Flow Control:
Flow control is a technique for assuring that a transmitting entity does not overwhelm a receiving entity with
data. Flow control is a set of procedures that tells the sender how much data it can transmit before it must wait
for an acknowledgment from the receiver.
The example assumes a 3-bit sequence number field and a maximum window size of seven frames. Initially, A
and B have windows indicating that A may transmit seven frames, beginning with frame 0 (FO). After
transmitting three frames (FO, F1, F2) without acknowledgment, A has shrunk its window to four frames. The
window indicates that A may transmit four frames, beginning with frame number 3. B then transmits an RR
(receive-ready) 3, which means: "I have received all frames up through frame number 2 and am ready to receive
frame number 3; in fact, I am prepared to receive seven frames, beginning with frame number 3." With this
acknowledgment, A is back up to permission to transmit seven frames, still beginning with frame 3. A proceeds
to transmit frames 3, 4, 5 , and 6. B returns an RR 4, which allows A to send up to and including frame F2.
Error Control allows the receiver to inform the sender of any frames lost or damaged in transmission and
coordinates the retransmission of those frames by the sender. Error control is divided in two main categories:
Error Detection It allows a receiver to check whether received data has been corrupted during transmission. It
can, for example, request a retransmission.
Error Correction This type of error control allows a receiver to reconstruct the original information when it has
been corrupted during transmission.
In the data link layer, the term error control refers primarily to methods of error detection and retransmission.
Error control in the data link layer is often implemented simply: Any time an error is detected in an exchange,
specified frames are retransmitted. This process is called automatic repeat request (ARQ).
Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.
Hamming distance:
One of the central concepts in coding for error control is the idea of the Hamming distance. The Hamming
distance between two words (of the same size) is the number of differences between the corresponding bits. We
show the Hamming distance between two words x and y as d(x, y). The Hamming distance can easily be found if
we apply the XOR operation on the two words and count the number of 1s in the result. Note that the Hamming
distance is a value greater than zero.
Error Detection:
There are three ways to detect errors.
1. Parity check
2. CRC
3. Checksum
CRC codes operate as follows. Consider the d-bit piece of data, D, that the sending node wants to send to the
receiving node. The sender and receiver must first agree on a r+1 bit pattern, known as a generator, which we
will denote as G. We will require that the high and low order bits of G must be 1 (e.g., 10111 is acceptable, but
0101 and 10110 are not) . The key idea behind CRC codes is shown in Figure. For a given piece of data, D, the
sender will choose r additional bits, R, and append them to D such that the resulting d+r bit pattern (interpreted
as a binary number) is exactly divisible by G using modulo 2 arithmetic. The process of error checking with
CRC's is thus simple: the receiver divides the d+r received bits by G. If the remainder is non-zero, the receiver
knows that an error has occurred; otherwise the data is accepted as being correct.
All CRC calculations are done in modulo 2 arithmetic without carries in addition or borrows in subtraction. This
means that addition and subtraction are identical, and both are equivalent to the bitwise exclusive-or (XOR) of
the operands. Thus, for example,
Multiplication and division are the same as in base 2 arithmetic, except that any required addition or
subtraction is done without carries or borrows. As in regular binary arithmetic, multiplication by 2 k left shifts a
bit pattern by k places. Thus, given D and R, the quantity D*2 r XOR R yields the d+r bit pattern shown in Figure
above.
International standards have been defined for 8-, 12-, 16- and 32-bit generators, G. An 8-bit CRC is used to
protect the 5-byte header in ATM cells.
Figure below illustrates this calculation for the case of D = 101110, d = 6 and G = 1001, r=3. The nine bits
transmitted in this case are 101110 011. You should check these calculations for yourself and also check that
indeed D2r = 101011 * G XOR R.
A second way to viewing the CRC process is to express all values as polynomials in a dummy variable X, with
binary coefficients. The coefficients corresponds to the bits in the binary number. Thus for D=110011 we have,
D(X)=X5+X4+X+1 for P=11001 we have P(X)=X4+X3+1. Arithmetic operations are again modulo 2.
Example1:
Suppose our data is a list of five 4-bit numbers that we want to send to a destination. In addition to sending these
numbers, we send the sum of the numbers. For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7, 11,
12,0,6,36), where 36 is the sum of the original numbers. The receiver adds the five numbers and compares the
result with the sum. If the two are the same, the receiver assumes no error, accepts the five numbers, and
discards the sum. Otherwise, there is an error somewhere and the data are not accepted.
Example2:
We can make the job of the receiver easier if we send the negative (complement) of the sum, called the
checksum. In this case, we send (7, 11, 12,0,6, -36). The receiver can add all the numbers received (including the
checksum). If the result is 0, it assumes no error; otherwise, there is an error
Internet Checksum
Traditionally, the Internet has been using a 16-bit checksum. The sender calculates the checksum by following
these steps.
Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to O.
3. All words including the checksum are added ushtg one's complement addition.
4. The sum is complemented and becomes the checksum.
5. The checksum is sent with the data.
Receiver site:
1. The message (including checksum) is divided into 16-bit words.
2. All words are added using one's complement addition.
3.The sum is complemented and becomes the new checksum.
4.If the value of checksum is 0, the message is accepted; otherwise, it is rejected.
Error Correction:
Any time an error is detected in an exchange, specified frames are retransmitted. This process is called automatic
repeat request (ARQ). Error control in the data link layer is based on automatic repeat request, which is the
retransmission of data.
• The receiver sends only +ve ACK for frame received safe and sound. It is silent about the frames
damaged or lost. The acknowledgement number always define the number of next expected frame. If
frame 0 is received, ACK1 is sent; if frame 1 is received ACK 0 is sent.
Bidirectional Transmission:
The stop-and-wait mechanism we have discussed is unidirectional. However, we can have bi-directional
transmission if the two parties have two separate channels for the full-duplex transmission or share the same
channel for half-duplex transmission.
Piggybacking: is a method to combine a data frame with an acknowledgement. For example, stations A and B
both have data to send. Instead of sending separate data and ACK frames, Station A sends a data frame that
includes an ACK , station B behaves in a similar manner.
Piggybacking can save BW because the overhead from a data frame and ACK frame (addresses, CRC, etc) can
be combined into just one frame.
b) Frame i is lost in transit. A subsequently sends frame (i + 1). B receives frame (i + 1) out of order and
sends an REJ i. A must retransmit frame i and all subsequent frames.
c) Frame i is lost in transit, and A does not soon send additional frames. B receives nothing and returns
neither an RR nor an REJ. When A's timer expires, it transmits an RR frame that includes a bit known as
b) If A's timer expires, it transmits an RR command as in Case lc. It sets another timer, called the P-bit
timer. If B fails to respond to the RR command, or if its response is damaged, then A's P-bit timer will
expire. At this point, A will try again by issuing a new RR command and restarting the P-bit timer. This
procedure is tried for a number of iterations. If A fails to obtain an acknowledgment after some
maximum number of attempts, it initiates a reset procedure.
Selective-reject ARQ
With selective-reject ARQ, the only frames retransmitted are those that receive a negative acknowledgment, in
this case called SREJ, or that time-out. This would appear to be more efficient than go-back-N, because it
minimizes the amount of retransmission. On the other hand, the receiver must maintain a buffer large enough to
save post-SREJ frames until the frame in error is retransmitted, and it must contain logic for reinserting that
frame in the proper sequence. The transmitter, too, requires more complex logic to be able to send a frame out of
sequence. Because of such complications, select-reject ARQ is much less used than go-back- N ARQ.
LEGEND
N(S) = Send sequence number
N(R) = Receive sequence number
P/F = Poll/final bit
S Frame:
Supervisory frames are used for flow and error control whenever piggybacking is either impossible or
inappropriate (e.g., when the station either has no data of its own to send or needs to send a command or
response other than an acknowledgment). S-frames do not have information fields.
• If the first 2 bits of the control field is 10, this means the frame is an S-frame.
• The last 3 bits, called N(R), corresponds to the acknowledgment number (ACK) or negative
acknowledgment number (NAK) depending on the type of S-frame.
• The 2 bits called code is used to define the type of S-frame itself. With 2 bits, we can have four types of
S-frames, as described below :
1. Receive ready (RR). If the value of the code subfield is 00, it is an RR S-frame. This kind of frame
acknowledges the receipt of a safe and sound frame or group of frames. In this case, the value N(R) field
defines the acknowledgment number.
2. Receive not ready (RNR). If the value of the code subfield is 10, it is an RNR S-frame. This kind of
frame is an RR frame with additional functions. It acknowledges the receipt of a frame or group of
frames, and it announces that the receiver is busy and cannot receive more frames. It acts as a kind of
congestion control mechanism by asking the sender to slow down. The value of NCR) is the
acknowledgment number.
3. Reject (REJ). If the value of the code subfield is 01, it is a REJ S-frame. This is a NAK frame, but not
like the one used for Selective Repeat ARQ. It is a NAK that can be used in Go-Back-N ARQ to
improve the efficiency of the process by informing the sender, before the sender time expires, that the
last frame is lost or damaged. The value of NCR) is the negative acknowledgment number.
4. Selective reject (SREJ). If the value of the code subfield is 11, it is an SREJ S-frame. This is a NAK
frame used in Selective Repeat ARQ. Note that the HDLC Protocol uses the term selective reject instead
of selective repeat. The value of N(R) is the negative acknowledgment number.
The fifth field in the control field is the P/F bit as discussed before.
The next 3 bits, called N(R), correspond to the ACK or NAK value.
Flag Field:
Flag fields delimit the frame at both ends with the unique pattern 01111110. A single flag may be used as the
closing flag for one frame and the opening flag for the next. On both sides of the user-network interface,
receivers are continuously hunting for the flag sequence to synchronize on the start of a frame. While receiving a
frame, a station continues to hunt for that sequence to determine the end of the frame. Since the pattern 01111110
may appear in the frame as well, a procedure know and bit stuffing is used.
After detecting a starting flag, the receiver monitors the bit stream. When a pattern of five 1s appears, the sixth
bit is examined. If this bit is 0, it is deleted. If the sixth bit is a 1 and the seventh bit is a 0, the combination is
accepted as a flag. If the sixth and seventh bits are both 1, the sender is indicating an abort condition. With the
use of bit stuffing, arbitrary bit patterns can be inserted into the data field of the frame. This property is known as
data transparency.
Address Field:
The address field identifies the secondary station that transmitted or is to receive the frame. This field is not
needed for point-to-point links, but is always included for the sake of uniformity.
Control Field: It defines the three types of frames I,U and S Frame for HDLC.
Information Field: This field is present only in I frame and some U Frame.
Frame Check Sequence Field: Its and error detecting code calculated from the remaining bits of the frame,
exclusive of flags. The normal code is 16 bit CRC code.
On the other hand, to keep PPP simple, several services are missing:
1. PPP does not provide flow control. A sender can send several frames one after another with no concern
about overwhelming the receiver.
2. PPP has a very simple mechanism for error control. A CRC field is used to detect errors. If the frame is
corrupted, it is silently discarded; the upper-layer protocol needs to take care of the problem. Lack of
error control and sequence numbering may cause a packet to be received out of order.
3. PPP does not provide a sophisticated addressing mechanism to handle frames in a multipoint
configuration.
Framing
PPP is a byte-oriented protocol. Framing is done according to the discussion of byte- oriented protocols above.
Flag. A PPP frame starts and ends with a I-byte flag with the bit pattern 01111110. Although this pattern is the
same as that used in HDLC, there is a big difference. PPP is a byte-oriented protocol; HDLC is a bit-oriented
protocol. The flag is treated as a byte, as we will explain later.
• Address. The address field in this protocol is a constant value and set to 11111111 (broadcast address).
During negotiation (discussed later), the two parties may agree to omit this byte.
• Control. This field is set to the constant value 11000000 (imitating unnumbered frames in HDLC). As
we will discuss later, PPP does not provide any flow control. Error control is also limited to error
detection. This means that this field is not needed at all, and again, the two parties can agree, during
negotiation, to omit this byte.
• Protocol. The protocol field defines what is being carried in the data field: either user data or other
information. We discuss this field in detail shortly. This field is by default 2 bytes long, but the two
parties can agree to use only 1 byte.
• Payload field. This field carries either the user data or other information. The data field is a sequence of
bytes with the default of a maximum of 1500 bytes; but this can be changed during negotiation. The data
field is byte- stuffed if the flag byte pattern appears in this field. Because there is no field defining the
size of the data field, padding is needed if the size is less than the maximum default value or the
maximum negotiated value.
Byte Stuffing
The similarity between PPP and HDLC ends at the frame format. PPP, as we discussed before, is a byte-oriented
protocol totally different from HDLC. As a byte-oriented protocol, the flag in PPP is a byte and needs to be
escaped whenever it appears in the data section of the frame. The escape byte is 01111101, which means that
every time the flaglike pattern appears in the data, this extra byte is stuffed to tell the receiver that the next byte
is not a flag.
PPP Stack
Although PPP is a data link layer protocol, PPP uses another set of other protocols to establish the link,
authenticate the parties involved, and carry the network layer data. Three sets of protocols are defined to make
PPP powetful: the Link Control Protocol (LCP), two Authentication Protocols (APs), and several Network
Control Protocols (NCPs). At any moment, a PPP packet can carry data from one of these protocols in its data
field. Note that there is one LCP, two APs, and several NCPs. Data may also come from several different
network layers.
The Link Control Protocol (LCP) is responsible for establishing, maintaining, configuring, and terminating
links. It also provides negotiation mechanisms to set options between the two endpoints. Both endpoints of the
link must reach an agreement about the options before the link can be established. All LCP packets are carried in
the payload field of the PPP frame with the protocol
field set to C02 1 in hexadecimal .
Authentication Protocols
Authentication plays a very important role in PPP because PPP is designed for use over dial-up links where
verification of user identity is necessary. Authentication means validating the identity of a user who needs to
access a set of resources. PPP has created two protocols for authentication: Password Authentication Protocol
and Challenge Handshake Authentication Protocol. Note that these protocols are used during the authentication
phase.
PAP The Password Authentication Protocol (PAP) is a simple authentication procedure with a two-step
process:
1. The user who wants to access a system sends an authentication identification (usually the user name) and
a password.
2. The system checks the validity of the identification and password and either accepts or denies
connection.
1. The system sends the user a challenge packet containing a challenge value, usually a few bytes.
2. The user applies a predefined function that takes the challenge value and the user's own password and
creates a result. The user sends the result in the response packet to the system.
3. The system does the same. It applies the same function to the password of the user (known to the
system) and the challenge value to create a result. If the result created is the same as the result sent in the
response packet, access is granted; otherwise, it is denied. CHAP is more secure than PAP, especially if
the system continuously changes the challenge value. Even if the intruder learns the challenge value and
the result, the password is still secret.
TCP/IP Model:
The U.S. Department of Defense (DOD) created the TCP/IP reference model because it wanted a network that
could survive any conditions
Application Layer:
The application layer handles high-level protocols, representation,
encoding, and dialog control. The TCP/IP protocol suite combines all
application related issues into one layer. It ensures that the data is
properly packaged before it is passed on to the next layer. TCP/IP
includes Internet and transport layer specifications such as IP and TCP
as well as specifications for common applications. TCP/IP has protocols
to support file transfer, e-mail, and remote login, in addition to the
following:
File Transfer Protocol (FTP) – FTP is a reliable, connection-
oriented service that uses TCP to transfer files between systems
that support FTP. It supports bi-directional binary file and
ASCII file transfers.
Trivial File Transfer Protocol (TFTP) – TFTP is a
connectionless service that uses the User Datagram Protocol
(UDP). TFTP is used on the router to transfer configuration files
and Cisco IOS images, and to transfer files between systems
that support TFTP. It is useful in some LANs because it
operates faster than FTP in a stable environment. TCP/IP Model
Network File System (NFS) – NFS is a distributed file system
protocol suite developed by Sun Microsystems that allows file access to a remote storage device such as
a hard disk across a network.
Simple Mail Transfer Protocol (SMTP) – SMTP administers the transmission of e-mail over computer
networks. It does not provide support for transmission of data other than plain text.
Telnet – Telnet provides the capability to remotely access another computer. It enables a user to log into
an Internet host and execute commands. A Telnet client is referred to as a local host. A Telnet server is
referred to as a remote host.
Simple Network Management Protocol (SNMP) – SNMP is a protocol that provides a way to monitor
and control network devices. SNMP is also used to manage configurations, statistics, performance, and
security.
Domain Name System (DNS) – DNS is a system used on the Internet to translate domain names and
publicly advertised network nodes into IP addresses.
Transport Layer:
The transport layer provides a logical connection between a source host and a destination host. Transport
protocols segment and reassemble data sent by upper-layer applications into the same data stream, or logical
connection, between end points.
• Creates packet from bytes stream received from the application layer.
• Uses port number to create process to process communication.
TCP is a connection-oriented transport layer protocol that provides reliable full-duplex data transmission. TCP is
part of the TCP/IP protocol stack. In a connection-oriented environment, a connection is established between
both ends before the transfer of information can begin. TCP breaks messages into segments, reassembles them at
the destination, and resends anything that is not received. TCP supplies a virtual circuit between end-user
applications.
TCP vs UDP:
S.no TCP - Transmission Control Protocol UDP - User Datagram Protocol
1 connection-oriented, reliable (virtual circuit) connectionless, unreliable, does not check message
delivery
2 Divides outgoing messages into segments sends “datagrams”
3 reassembles messages at the destination does not reassemble incoming messages
4 re-sends anything not received Does-not acknowledge.
Internet Layer:
The purpose of the Internet layer is to select the best path through the network for packets to travel. The main
protocol that functions at this layer is IP. Best path determination and packet switching occur at this layer.
The following protocols operate at the TCP/IP Internet layer:
IP provides connectionless, best-effort delivery routing of packets. IP is not concerned with the content
of the packets but looks for a path to the destination.
Internet Control Message Protocol (ICMP) provides control and messaging capabilities.
Address Resolution Protocol (ARP) determines the data link layer address, or MAC address, for known
IP addresses.
Reverse Address Resolution Protocol (RARP) determines the IP address for a known MAC address.
IP performs the following operations:
Defines a packet and an addressing scheme
Transfers data between the Internet layer and network access layer
Routes packets to remote hosts
IP Address:
Each computer in a TCP/IP network must be given a unique identifier, or IP address. This address, which
operates at Layer 3, allows one computer to locate another computer on a network. All computers also have a
unique physical address, which is known as a MAC address. These are assigned by the manufacturer of the NIC.
MAC addresses operate at Layer 2 of the OSI model.
An IP address (IPv4) is a 32-bit sequence of ones and zeros.To make the IP address easier to work with, it is
usually written as four decimal numbers separated by periods. For example, an IP address of one computer is
192.168.1.2. Another computer might have the address 128.10.2.1. This is called the dotted decimal format. Each
part of the address is called an octet because it is made up of eight binary digits. For example, the IP address
192.168.1.8 would be 11000000.10101000.00000001.00001000 in binary notation. The dotted decimal notation
is an easier method to understand than the binary ones and zeros method. This dotted decimal notation also
prevents a large number of transposition errors that would result if only the binary numbers were used.
Fig:IPV4 Header
Version:(4 bits): Indicates the version number, to allow evolution of the protocol.
Internet Header Lenght(IHL 4 bits): Length of header in 32 bit words. The minimum value is five for a
minimum header length of 20 octets.
Type-of-Service :
The Type-of-Service field contains an 8-bit binary value that is used to determine the priority of each packet.
This value enables a Quality-of-Service (QoS) mechanism to be applied to high priority packets, such as those
carrying telephony voice data. The router processing the packets can be configured to decide which packet it is
to forward first based on the Type-of-Service value.
Identifier (16 bits): A sequence number that, together with the source address, destination address, and user
protocol, is intended to uniquely identify a datagram. Thus, the identifier should be unique for the datagram's
source address, destination address, and user protocol for the time during which the datagram will remain in the
internet.
Fragment Offset : A router may have to fragment a packet when forwarding it from one medium to another
medium that has a smaller MTU. When fragmentation occurs, the IPv4 packet uses the Fragment Offset field and
the MF flag in the IP header to reconstruct the packet when it arrives at the destination host. The fragment offset
field identifies the order in which to place the packet fragment in the reconstruction.
Flags(3 bits): Only two of the bits are currently defined: MF(More Fragments) and DF(Don't Fragment):
More Fragments flag (MF):The More Fragments (MF) flag is a single bit in the Flag field used with the
Fragment Offset for the fragmentation and reconstruction of packets. The More Fragments flag bit is set, it
means that it is not the last fragment of a packet. When a receiving host sees a packet arrive with the MF = 1, it
examines the Fragment Offset to see where this fragment is to be placed in the reconstructed packet. When a
receiving host receives a frame with the MF = 0 and a non-zero value in the Fragment offset, it places that
fragment as the last part of the reconstructed packet. An unfragmented packet has all zero fragmentation
information (MF = 0, fragment offset =0).
IP Destination Address
The IP Destination Address field contains a 32-bit binary value that represents the packet destination Network
layer host address.
IP Source Address
The IP Source Address field contains a 32-bit binary value that represents the packet source Network layer host
address.
Time-to-Live
The Time-to-Live (TTL) is an 8-bit binary value that indicates the remaining "life" of the packet. The TTL value
is decreased by at least one each time the packet is processed by a router (that is, each hop). When the value
becomes zero, the router discards or drops the packet and it is removed from the network data flow. This
mechanism prevents packets that cannot reach their destination from being forwarded indefinitely between
routers in a routing loop. If routing loops were permitted to continue, the network would become congested with
data packets that will never reach their destination. Decrementing the TTL value at each hop ensures that it
eventually becomes zero and that the packet with the expired TTL field will be dropped.
Protocol:
This 8-bit binary value indicates the data payload type that the packet is carrying. The Protocol field enables the
Network layer to pass the data to the appropriate upper-layer protocol.
Header checksum (16 bits): An error-detecting code applied to the header only. Because some header fields
may change during transit (e.g., time to live, segmentation-related fields), this is reverified and recomputed at
each router. The checksum field is the 16-bit one's complement addition of all 16-bit words in the header. For
purposes of computation, the checksum field is itself initialized to a value of zero .
Class A Blocks
A class A address block was designed to support extremely large networks with more than 16 million host
addresses. Class A IPv4 addresses used a fixed /8 prefix with the first octet to indicate the network address. The
remaining three octets were used for host addresses.
The first bit of a Class A address is always 0. With that first bit a 0, the lowest number that can be represented is
00000000, decimal 0. The highest number that can be represented is 01111111, decimal 127. The numbers 0 and
127 are reserved and cannot be used as network addresses. Any address that starts with a value between 1 and
126 in the first octet is a Class A address.
No of Class A Network: 27
No. of Usable Host address per Network: 224-2 (Minus 2 because 2 addresses are reserved for network and
broadcast address)
Class B Blocks
Class B address space was designed to support the needs of moderate to large size networks with more than
65,000 hosts. A class B IP address used the two high-order octets to indicate the network address. The other two
octets specified host addresses. As with class A, address space for the remaining address classes needed to be
reserved.
The first two bits of the first octet of a Class B address are always 10. The remaining six bits may be populated
with either 1s or 0s. Therefore, the lowest number that can be represented with a Class B address is 10000000,
decimal 128. The highest number that can be represented is 10111111, decimal 191. Any address that starts with
a value in the range of 128 to 191 in the first octet is a Class B address.
No of Class B Network: 214
No. of Usable Host address per Network: 216-2
Class C Blocks:
The class C address space was the most commonly available of the historic address classes. This address space
was intended to provide addresses for small networks with a maximum of 254 hosts.
Class C address blocks used a /24 prefix. This meant that a class C network used only the last octet as host
addresses with the three high-order octets used to indicate the network address.
A Class C address begins with binary 110. Therefore, the lowest number that can be represented is 11000000,
decimal 192. The highest number that can be represented is 11011111, decimal 223. If an address contains a
number in the range of 192 to 223 in the first octet, it is a Class C address.
No of Class C Network: 221
No. of Usable Host address per Network: 28-2
Class E Block:
A Class E address has been defined. However, the Internet Engineering Task Force (IETF) reserves these
addresses for its own research. Therefore, no Class E addresses have been released for use in the Internet. The
first four bits of a Class E address are always set to 1s. Therefore, the first octet range for Class E addresses is
11110000 to 11111111, or 240 to 255.
Every IP address also has two parts. The first part identifies the network (Network ID)where the system is
connected and the second part identifies the system (Host ID).
Class A
Class B
Class C
Within the address range of each IPv4 network, we have three types of addresses:
Network address - The address by which we refer to the network
Broadcast address - A special address used to send data to all hosts in the network
Host addresses - The addresses assigned to the end devices in the network
Network and Broadcast Addresses: As explained earlier, within each network the first and last addresses
cannot be assigned to hosts. These are the network address and the broadcast address, respectively.
Loopback: One such reserved address is the IPv4 loopback address 127.0.0.1. The loopback is a special address
that hosts use to direct traffic to themselves. Although only the single 127.0.0.1 address is used, addresses
127.0.0.0 to 127.255.255.255 are reserved. Any address within this block will loop back within the local host.
No address within this block should ever appear on any network.
Link-Local Addresses: IPv4 addresses in the address block 169.254.0.0 to 169.254.255.255 (169.254.0.0 /16)
are designated as link-local addresses. These addresses can be automatically assigned to the local host by the
operating system in environments where no IP configuration is available. These might be used in a small peer-to-
peer network or for a host that could not automatically obtain an address from a Dynamic Host Configuration
Protocol (DHCP) server.
TEST-NET Addresses : The address block 192.0.2.0 to 192.0.2.255 (192.0.2.0 /24) is set aside for teaching and
learning purposes. These addresses can be used in documentation and network examples
Network Prefixes: An important question is: How do we know how many bits represent the network portion
and how many bits represent the host portion? When we express an IPv4 network address, we add a prefix length
to the network address. The prefix length is the number of bits in the address that gives us the network portion.
For example, in 172.16.4.0 /24, the /24 is the prefix length - it tells us that the first 24 bits are the network
address. This leaves the remaining 8 bits, the last octet, as the host portion.
Subnet Mask:
To define the network and host portions of an address, the devices use a separate 32-bit pattern called a subnet
mask. We express the subnet mask in the same dotted decimal format as the IPv4 address. The subnet mask is
created by placing a binary 1 in each bit position that represents the network portion and placing a binary 0 in
CIDR:
A routing system used by routers and gateways on the backbone of the Internet for routing packets. CIDR
replaces the old class method of allocating 8, 16, or 24 bits to the network ID, and instead allows any number of
contiguous bits in the IP address to be allocated as the network ID. For example, if a company needs a few
thousand IP addresses for its network, it can allocate 11 or 12 bits of the address for the network ID instead of 8
bits for a class C (which wouldn’t work because you would need to use several class C networks) or 16 bits for
class B (which is wasteful).
How It Works
CIDR assigns a numerical prefix to each IP address. For example, a typical destination IP address using CIDR
might be 177.67.5.44/13. The prefix 13 indicates that the first 13 bits of the IP address identify the network,
while the remaining 32 - 13 = 19 bits identify the host. The prefix helps to identify the Internet destination
gateway or group of gateways to which the packet will be forwarded. Prefixes vary in size, with longer prefixes
indicating more specific destinations. Routers use the longest possible prefix in their routing tables when
determining how to forward each packet. CIDR enables packets to be sent to groups of networks instead of to
individual networks, which considerably simplifies the complex routing tables of the Internet’s backbone routers.
1. No of subnetwork = 2BB
2. No. of usable hosts per subnetwork=2BR-2
TB=BR + BB
TB=Total bits in host portion
BB=Bits borrowed
BR=Bits Remaining
How many hosts per subnet? We have 6 host bits off (11000000), so the equation would
be 26 – 2 = 62 hosts.
What are the valid subnets? 256 – 192 = 64. Remember, we start at zero and count in our
block size, so our subnets are 0, 64, 128, and 192. (Magic Number=256-Subnet Mask)
What’s the broadcast address for each subnet? The number right before the value of the next
subnet is all host bits turned on and equals the broadcast address. For the zero subnet, the
What are the valid hosts? These are the numbers between the subnet and broadcast address.
The easiest way to find the hosts is to write out the subnet address and the broadcast address.
This way, the valid hosts are obvious. The following table shows the 0, 64, 128, and 192 sub-
nets, the valid host ranges of each, and the broadcast address of each subnet:
255.255.128.0 (/17)
172.16.0.0 = Network address
255.255.128.0 = Subnet mask
Subnets? 21 = 2 (same as Class C).
Hosts? 215 – 2 = 32,766 (7 bits in the third octet, and 8 in the fourth).
Valid subnets? 256 – 128 = 128. 0, 128. Remember that subnetting is performed in the third octet, so the subnet
numbers are really 0.0 and 128.0, as shown in the next table.
These are the exact numbers we used with Class C; we use them in the third octet and add a 0 in the fourth octet
for the network address.
Valid subnets? 256 – 192 = 64. 0, 64, 128, 192. Remember that the subnetting is performed in the third octet, so
the subnet numbers are really 0.0, 64.0, 128.0, and 192.0,
as shown in the next table.
The following table shows the four subnets available, the valid host range, and the broadcast address of each:
Another Example:172.16.0.0/25
255.255.255.128 (/25)
This is one of the hardest subnet masks you can play with. And worse, it actually is a really
good subnet to use in production because it creates over 500 subnets with 126 hosts for each
subnet—a nice mixture. So, don’t skip over it!
172.16.0.0 = Network address
255.255.255.128 = Subnet mask
Subnets? 29 = 512.
Hosts? 27 – 2 = 126.
Valid subnets? Okay, now for the tricky part. 256 – 255 = 1. 0, 1, 2, 3, etc. for the third octet. But you can’t
forget the one subnet bit used in the fourth octet. You actually get two subnets for each third octet value, hence
the 512 subnets. For example, if the third octet is showing subnet 3, the two subnets would actually be 3.0 and
3.128.
Broadcast address for each subnet?
Valid hosts?
The following table shows how you can create subnets, valid hosts, and broadcast addresses using the Class B
255.255.255.128 subnet mask (the first eight subnets are shown, and then the last two subnets):
Subnet 0.0 0.128 1.0 1.128 2.0 2.128 3.0 3.128 ... 255.0 255.128
Broadcast 0.127 0.255 1.127 1.255 2.127 2.255 3.127 3.255 ... 255.127 255.255
First host 0.1 0.129 1.1 1.129 2.1 2.129 3.1 3.129 ... 255.1 255.129
Last host 0.126 0.254 1.126 1.254 2.126 2.254 3.126 3.254 ... 255.126 255.254
IPV6:
Features of IPV6:
• Larger address space Offers improved global reachability and flexibility; the aggregation of prefixes
that are announced in routing tables; multihoming to several Internet service providers (ISPs) auto
configuration that can include link-layer addresses in the address space; plug-and-play options; public-to
private readdressing end to end without address translation; and simplified mechanisms for address
renumbering and modification.
• Mobility and security: Ensures compliance with mobile IP and IPsec standards functionality; mobility
is built in, so any IPv6 node can use it when necessary; and enables people to move around in networks
with mobile network devices—with many having wireless connectivity.
Mobile IP is an Internet Engineering Task Force (IETF) standard available for both IPv4 and IPv6. The
standard enables mobile devices to move without breaks in established network connections. Because
IPv4 does not automatically provide this kind of mobility, you must add it with additional
configurations.
IPsec is the IETF standard for IP network security, available for both IPv4 and IPv6. Although the
functionalities are essentially identical in both environments, IPsec is mandatory in IPv6. IPsec is
enabled on every IPv6 node and is available for use. The availability of IPsec on all nodes makes the
IPv6 Internet more secure. IPsec also requires keys for each party, which implies a global key
deployment and distribution.
• Transition richness: You can incorporate existing IPv4 capabilities in IPv6 in the following ways:
• Configure a dual stack with both IPv4 and IPv6 on the interface of a network device.
• Use the technique IPv6 over IPv4 (also called 6to4 tunneling), which uses an IPv4 tunnel to
carry IPv6 traffic. This method (RFC 3056) replaces IPv4-compatible tunneling (RFC 2893).
Cisco IOS Software Release 12.3(2)T (and later) also allows protocol translation (NAT-PT)
between IPv6 and IPv4. This translation allows direct communication between hosts speaking
different protocols.
IPv4 VS IPv6
header checksum A number that is computed to ensure the integrity of the header values.
source address The 32-bit IPv4 address of the sending host.
destination address The 32-bit IPv4 address of the receiving host.
Options A list of optional specifications for security restrictions, route recording, and source routing. Not every
datagram specifies an options field.
Padding Null bytes which are added to make the header length an integral multiple of 32 bytes as required by
the header length field.
Ipv6 header:
IPV6 Addressing:
Address Representation:
Represented by breaking 128 bit into Eight 16-bit segments (Each 4 Hex character each)
Each segment is written in Hexadecimal separated by colons.
Hex digit are not case sensitive.
Rule 1:
Drop leading zeros:
2001:0050:0000:0235:0ab4:3456:456b:e560
2001:050:0:235:ab4:3456:456b:e560
Rule2:
Successive fields of zeros can be represented as “::” , But double colon appear only once in the address.
FF01:0:0:0:0:0:0:1
FF01::1
Note : An address parser identifies the number of missing zeros by separating the two parts and entering 0 until
the 128 bits are complete. If two “::” notations are placed in the address, there is no way to identify the size of
each block of zeros.
Ipv4 vs ipv6
IPV4 IPV6
1. source and destination addresses are 32 bits.) 1. Source and destination addresses are 128 bits.
2. ipv4 support small address space. 2. Supports a very large address space sufficeint for
each and every people on earth.
3. ipv4 header includes checksum. 3. ipv6 header doesn't includes the checksum. (the
upper-layer protocol or security extension header
handles data integrity)
4. addresses are represented in dotted decimal format. 4. Addresses are represented in 16-bit segments
(Eg. 192.168.5.1) Each segment is written in Hexadecimal separated by
colons. (Eg.
2001:0050:020c:0235:0ab4:3456:456b:e560
5. Header includes options. All optional data is moved to IPV6 extension header..
6. Broadcast address are used to send traffic to all 6. There is no IPV6 broadcast address. Instead a link
Dual Stack:
Dual stack is an integration method where a node has implementation and connectivity to both Ipv4 and ipv6
network. If both ipv4 and ipv6 are configured on an interface, this interface is dual-stacked.
Tunneling Technique
With manually configured IPv6 tunnels, an IPv6 address is configured on a tunnel interface, and manually
configured IPv4 addresses are assigned to the tunnel source and the tunnel destination. The host or router at each
end of a configured tunnel must support both the IPv4 and IPv6 protocol stacks.
The original Hypertext Transfer Protocol (HTTP) 1.0 protocol is a stateless protocol whereby a Web browser
forms a connection with a Web server, downloads the appropriate file, and then terminates the connection. The
browser usually requests a file using an HTTP GET method request on TCP port 80, which consists of a series of
HTTP request headers that define the transaction method (GET, POST, HEAD, and so on) and indicates to the
server the capabilities of the client. The server responds with a series of HTTP response headers that indicate
whether the transaction is successful, the type of data being sent, the type of server, and finally the requested
data.
IIS 4 supports a new version of this protocol called HTTP 1.1, which has new features that make it more
efficient. These new features include the following:
• Persistent connections:
An HTTP 1.1 server can keep TCP connections open after a file has been transferred, eliminating the
need for a connection to be opened and closed each time a file is transferred, as is the case with HTTP
1.0.
• Pipelining:
This is a process whereby an HTTP 1.1 client can send multiple Internet Protocol (IP) packets to the
server without waiting for the server to respond to each packet.
• Buffering:
This process allows several HTTP requests by the client to be buffered into a single packet and sent to
the server, which results in faster transfer times because fewer and larger packets are used.
• Host headers:
This feature enables an HTTP 1.1–compliant Web server to host multiple Web sites using a single IP
address.
• Http put and http delete commands:
These commands enable Web browsers to upload and delete files from Web servers using HTTP.
Domain Name
Each node in the tree has a domain name. A
full domain name is a sequence of labels
separated by dots (.). The domain names are
always read from the node up to the root.
The last label is the label of the root (null).
This means that a full domain name always
ends in a null label, which means the last
character is a dot because the null string is
nothing. Figure shows some domain names.
Generic Domains
The generic domains define registered hosts according to their generic behavior. Each node in the tree defines a
domain, which is an index to the domain name space database
Country Domains
The country domains section uses two-character country abbreviations (e.g., np for Nepal and us for United
States). Second labels can be organizational, or they can be more specific, national designations. The United
States, for example, uses state abbreviations as a subdivision of us (e.g., ca.us.).
Inverse Domain
The inverse domain is used to map an address to a name. This may happen, for example, when a server has
received a request from a client to do a task. This type of query is called an inverse or pointer (PTR) query. To
handle a pointer query, the inverse domain is added to the domain name space with the first-level node called
arpa (for historical reasons). The second level is also one single node named in-addr (for inverse address). The
rest of the domain defines IP addresses.
SMTP supports sending of emai only It cannot pull messages from a remote server on demand. Other protocols,
such as the Post Office Protocol (POP) and the Internet Message Access Protocol (IMAP) are specifically
designed for retrieving messages and managing mail boxes. However, SMTP has a feature to initiate mail queue
processing on a remote server so that the requesting system may receive any messages destined for it (cf.
Remote Message Queue Starting). POP and IMAP are preferred protocols when a user's personal computer is
only intermittently powered up, or Internet connectivity is only transient and hosts cannot receive message
during off-line periods.
The overall flow for message creation, mail transport, and delivery may be illustrated as shown.
Email is submitted by a mail client (MUA, mail user agent) to a mail server (MSA, mail submission agent)
using SMTP on TCP port 587. Most mailbox providers still allow submission on traditional port 25. From there,
the MSA delivers the mail to its mail transfer agent (MTA, mail transfer agent). Often, these two agents are just
different instances of the same software launched with different options on the same machine. Local processing
can be done either on a single machine, or split among various appliances; in the former case, involved processes
can share files; in the latter case, SMTP is used to transfer the message internally, with each host configured to
use the next appliance as a smart host. Each process is an MTA in its own right; that is, an SMTP server.
The boundary MTA has to locate the target host. It uses the Domain name system (DNS) to look up the mail
exchanger record (MX record) for the recipient's domain (the part of the address on the right of @). The returned
MX record contains the name of the target host. The MTA next looks up the A record for that name in order to
get the IP address and connect to such host as an SMTP client.
Once the MX target accepts the incoming message, it hands it to a mail delivery agent (MDA) for local mail
delivery. An MDA is able to save messages in the relevant mailbox format. Again, mail reception can be done
using many computers or just one —the picture displays two nearby boxes in either case. An MDA may deliver
IMAP VS POP:
IPSEC
IPsec provides a mechanism for secure data transmission over IP networks, ensuring confidentiality, integrity,
and authenticity of data communications over unprotected networks such as the Internet . IPsec encompasses a
suite of protocols and is not bound to any specific encryption or authentication algorithms, key generation
technique, or security association (SA). IPsec provides the rules while existing algorithms provide the
encryption, authentication, key management, and so on. IPsec acts at the network layer, protecting and
authenticating IP packets between IPsec devices (peers), such as Cisco PIX Firewalls, Adaptive Security
Apliances (ASA), Cisco routers, the Cisco Secure VPN Client, and other IPsec-compliant products.
IPsec is an Internet Engineering Task Force (IETF) standard (RFC 2401-2412) that defines how a VPN can be
created over IP networks.
Data confidentiality: IPsec ensures confidentiality by using encryption. Data encryption prevents third parties
from reading the data, especially data that is transmitted over public networks or wireless networks. The IPsec
sender can encrypt packets before transmitting the packets across a network and prevent anyone from hearing or
viewing the communication (eavesdropping).
Data integrity: IPsec ensures that data arrives unchanged at the destination; that is, that the data is not
manipulated at any point along the communication path. IPsec ensures data integrity by using hashes.
Data origin authentication: The IPsec receiver can authenticate the source of the IPsec packets. Authentication
ensures that the connection is actually made with the desired communication partner.
proxy server
A computer that can act on the behalf of other computers to request content from the Internet or an intranet.
Proxy Server is placed between a user's machine and the Internet. It can act as a firewall to provide protection
and as a cache area to speed up Web page display.
A firewall mechanism that replaces the IP address of a host on the internal (protected) network with its own IP
address for all traffic passing through it. A software agent that acts on behalf of a user, typical proxies accept a
connection from a user, make a decision as to whether or not the user or client IP address is permitted to use the
proxy, perhaps does additional authentication, and then completes a connection on behalf of the user to a remote
destination.
Types of Proxy:
1. Forward Proxy:
Forward proxies are proxies where the client server names the target server to connect to. Forward proxies are
able to retrieve from a wide range of sources (in most cases anywhere on the Internet).
The terms "forward proxy" and "forwarding proxy" are a general description of behavior (forwarding traffic) and
thus ambiguous. Except for Reverse proxy
Fig:A forward proxy taking requests from an internal network and forwarding
them to the Internet
2. Open Proxy:
An open proxy is a forward proxy server that is accessible by any Internet user. Gordon Lyon estimates there are
"hundreds of thousands" of open proxies on the Internet.[4] An anonymous open proxy allows users to conceal
their IP address while browsing the Web or using other Internet services.
3. Reverse Proxy:
A reverse proxy is a proxy server that appears to clients to be an ordinary server. Requests are forwarded to one
or more origin servers which handle the request. The response is returned as if it came directly from the proxy
server
Fig: A reverse proxy taking requests from the Internet and forwarding them to
servers in an internal network. Those making requests connect to the proxy and
may not be aware of the internal network.
The two types differ from the way they send the
data. When a file is sent using an ASCII-type
transfer, the individual letters, numbers and
characters are sent. The receiving machine saves
these in a text file in the appropriate format (for
example, a Unix machine saves it in a Unix format, a
Macintosh saves it in a Mac format). Hence if an
ASCII transfer is used it can be assumed plain text is
sent, which is stored by the receiving computer in its
own format.
Configuration Management
A large network is usually made up of hundreds of entities that are physically or logically connected to one
another. These entities have an initial configuration when the network is set up, but can change with time.
Desktop computers may be replaced by others; application software may be updated to a newer version; and
users may move from one group to another. The configuration management system must know, at any time, the
status of each entity and its relation to other entities . Configuration management can be subdivided into two
parts reconfiguration and Documentation.
Fault Management:
Falls on two categories.
• Reactive Fault Management
A reactive fault management system is responsible for detecting, isolating, correcting, and recording
faults. It handles short-term solutions to faults.
• Proactive Fault Management
Proactive fault management tries to prevent faults from occurring. Although this is not always possible,
some types of failures can be predicted and prevented.
Performance management:
It is is closely related to fault management and tries to monitor and control the network to ensure that it is
running as efficiently as possible.
Security Management
Security management is responsible for controlling access to the network based on the predefined policy.
Accounting Management
Accounting management is the control of users' access to network resources through charges. Charging does not
necessarily mean cash transfer; it may mean debiting the departments or divisions for budgeting purposes.
Today, organizations use an accounting management system for the following reasons:
• It prevents users from monopolizing limited network resources.
• It prevents users from using the system inefficiently.
• Network managers can do short- and long-term planning based on the demand for network use.
The Simple Network Management Protocol (SNMP) is a framework for managing devices in an Internet using
the TCPIIP protocol suite. It provides a set of fundamental operations for monitoring and maintaining an
Internet.
Concept
SNMP uses the concept of manager and agent. That is, a manager, usually a host, controls and monitors a set of
agents, usually routers . SNMP is an application-level protocol in which a few manager stations control a set of
agents. The protocol is designed at the application level so that it can monitor devices made by different
manufacturers and installed on different physical networks.
SNMP operates in the Application Layer of the Internet Protocol Suite (Layer 7 of the OSI model). The SNMP
agent receives requests on UDP port 161. The manager may send requests from any available source port to port
161 in the agent. The agent response will be sent back to the source port on the manager. The manager receives
notifications (Traps and InformRequests) on port 162. The agent may generate notifications from any available
port.
Role of SNMP
SNMP has some very specific roles in network management. It defines the format of the packet to be sent from a
manager to an agent and vice versa. It also interprets the result and creates statistics (often with the help of other
management software). The packets exchanged contain the object (variable) names and their status (values).
SNMP is responsible for reading and changing these values.
Roles of SMI
SMI defines the general rules for naming objects, defining object types (including range and length), and
showing how to encode objects and values. SM1 does not define the number of objects an entity should manage
or name the objects to be managed or define the association between the objects and their values.
The Structure of Management Information, version 2 (SMIv2) is a component for network management. Its
functions are
1. To name objects
2. To define the type of data that can be stored in an object
3. To show how to encode data for transmission over the network
SMI is a guideline for SNMP. It emphasizes three attributes to handle an object: name, data type, and encoding
method .
Roles of MIB
For each entity to be managed, this protocol must define the number of objects, name them according to the rules
defined by SMI, and associate a type to each named object .MIB creates a collection of named objects, their
types, and their relationships to each other in an entity to be managed.
Each agent has its own MIB2, which is a collection of all the objects that the manager can manage. The objects
in MIB2 are categorized under 10 different groups: system, interface, address translation, ip, icmp, tcp, udp, egp,
transmission, and snmp.
Analogy:
We can compare the task of network management to the task of writing a program.
• Both tasks need rules. In network management this is handled by SMI.
• Both tasks need variable declarations. In network management this is handled by MIB.
• Both tasks have actions performed by statements. In network management this is handled by SNMP.
Cipher
We refer to encryption and decryption algorithms as ciphers. The term cipher is also used to refer to different
categories of algorithms in cryptography. This is not to say that every sender-receiver pair needs their very own
unique cipher for a secure communication. On the contrary, one cipher can serve millions of communicating
pairs.
Key
A key is a number (or a set of numbers) that the cipher, as an algorithm, operates on. To encrypt a message, we
need an encryption algorithm, an encryption key, and the plain-text. These create the cipher-text. To decrypt a
message, we need a decryption algorithm, a decryption key, and the cipher-text. These reveal the original plain-
text.
Cryptography
In conventional cryptography, also called secret-key or symmetric-key encryption, one key is used both for
encryption and decryption. The Data Encryption Standard (DES) is an example of a conventional cryptosystem
that is widely employed by the Federal Government. Figure below shows an illustration of the conventional
encryption process.
Conventional encryption has benefits. It is very fast. It is especially useful for encrypting data that is not going
anywhere. However, conventional encryption alone as a means for transmitting secure data can be quite
expensive simply due to the difficulty of secure key distribution.
For a sender and recipient to communicate securely using conventional encryption, they must agree upon a key
and keep it secret between themselves. If they are in different physical locations, they must trust a courier, the
Bat Phone, or some other secure communication medium to prevent the disclosure of the secret key during
transmission. Anyone who overhears or intercepts the key in transit can later read, modify, and forge all
information encrypted or authenticated with that key.
Asymmetric-Key Cryptography
Public key cryptography is an asymmetric scheme that uses a pair of keys for encryption: a public key, which
encrypts data, and a corresponding private, or secret key for decryption. You publish your public key to the
world while keeping your private key secret. Anyone with a copy of your public key can then
encrypt information that only you can read . It is computationally infeasible to deduce the private key from the
public key. Anyone who has a public key can encrypt information but cannot decrypt it. Only the person who has
the corresponding private key can decrypt the information.
With this approach, all the participants have access to public keys, and private keys are generated locally by
each participant and therefore need never be distributed. As long as a user protects his and her private key,
incoming communication is secure. At any time, a user change the private key and publish the companion public
key replace the old public key.
Comparison
Let us compare symmetric-key and asymmetric-key cryptography. Encryption can be thought of as electronic
locking; decryption as electronic unlocking. The sender puts the message in a box and locks the box by using a
key; the receiver unlocks the box with a key and takes out the message. The difference lies in the mechanism of
the locking and unlocking and the type of keys used. In symmetric-key cryptography, the same key locks and
unlocks the box. In asymmetric-key cryptography, one key locks the box, but another key is needed to unlock it.
Substitution cipher:
A substitution cipher substitutes one symbol with another. If the symbols in the plain- text are alphabetic
characters, we replace one character with another. For example, we can replace character A with D, and character
T with Z. If the symbols are digits (0 to 9), we can replace 3 with 7, and 2 with 6. It is also known and Ceaser's
Cipher who invented it.
For example, if we encode the word “SECRET” using Caesar’s key value of 3, we offset the alphabet so that the
3rd letter down (D) begins the alphabet.
So starting with
ABCDEFGHIJKLMNOPQRSTUVWXYZ
and sliding everything up by 3, you get
DEFGHIJKLMNOPQRSTUVWXYZABC
where D=A, E=B, F=C, and so on.
Using this scheme, the plaintext, “SECRET” encrypts as “VHFUHW.” To allow someone else to read the
ciphertext, you tell them that the key is 3.
Transposition Ciphers
In a transposition cipher, there is no substitution of characters; instead, their locations change. A character in the
first position of the plaintext may appear in the tenth position of the ciphertext. A character in the eighth position
may appear in the first position. In other words, a transposition cipher reorders the symbols in a block of
symbols.
Key In a transposition cipher, the key is a mapping between the position of the symbols in the plaintext and
cipher text. For example, the following shows the key using a block of four characters:
Plaintext: 2413
Ciphertext: 1234
In encryption, we move the character at position 2 to position 1, the character at position 4 to position 2, and so
on. In decryption, we do the reverse.
Encryption algorithm:
The most commonly used symmetric encryption are block ciphers. A block cipher processes the plain text input
in fixed size blocks and produces a block of cipher text of equal size for each palintext block.
DES has two transposition blocks (P-boxes) and 16 complex round ciphers (they are repeated). Although the 16
iteration round ciphers are conceptually the same, each uses a different key derived from the original key.
The initial and final permutations are keyless straight permutations that are the inverse of each other. The
permutation takes a 64-bit input and permutes them according to predefined values. Each round of DES is a
complex round cipher, as shown in Figure below. Note that the structure of the encryption round ciphers is
different from that of the decryption one.
Digital signatures
A major benefit of public key cryptography is that it provides a method for employing digital signatures. Digital
signatures enable the recipient of information to verify the authenticity of the information’s origin, and also
verify that the information is intact. Thus, public key digital signatures
provide authentication and data integrity. A digital signature also provides non-repudiation, which means that it
prevents the sender from claiming that he or she did not actually send the information. These features are every
bit as fundamental to cryptography as privacy, if not more.
A digital signature serves the same purpose as a handwritten signature. However, a handwritten signature is easy
to counterfeit. A digital signature is superior to a handwritten signature in that it is nearly impossible to
counterfeit, plus it attests to the contents of the information as well as to the identity of the signer. Some people
tend to use signatures more than they use encryption. For example, you may not care if anyone knows that you
just deposited $1000 in your account, but you do want to be darn sure it was the bank teller you were dealing
with.
The basic manner in which digital signatures are created is illustrated in Figure . Instead of encrypting
information using someone else’s public key, you encrypt it with your private key. If the information can be
decrypted with your public key, then it must have originated with you.
Firewall
Any system or device that allows safe network traffic to pass while restricting or denying unsafe traffic.
Firewalls are usually dedicated machines running at the gateway point between your local network and the
outside world, and are used to control who has access to your private corporate network from the outside—for
example, over the Internet. More generally, a firewall is any system that controls communication between two
networks. In today’s networking environment in which corporate networks are connected to the Internet—
inviting hackers to attempt unauthorized access to valuable business information—a corporate firewall is
essential.
Types of Firewall
Packet-filtering routers can also be configured to block certain kinds of traffic while permitting others. Usually
this is done by disabling or enabling different TCP/IP ports on the firewall system. For example, port 25 is
usually left open to permit Simple Mail Transfer Protocol (SMTP) mail to travel between the private corporate
network and the Internet, while other ports (such as port 23 for Telnet) might be disabled to prevent Internet
users from accessing other services on corporate network servers. The difficulty with this approach is that the
size of the access list for the firewall can become huge if a large number of domains or ports are blocked and a
large number of exceptions are configured. Some ports are randomly assigned to certain services (such as remote
procedure call services) on startup; it is more difficult to configure firewalls to control access to these ports.
Circuit-level Firewall:
Another type of firewall is a circuit-level gateway, which is usually a component of a proxy server. Circuit-level
gateways essentially operate at a higher level of the OSI model protocol stack than network-level firewalls do.
With a circuit-level firewall, connections with the private network are hidden from the remote user. The remote
user connects with the firewall, and the firewall forms a separate connection with the network resource being
accessed after changing the IP address of the packets being transmitted in either direction through the firewall.
The result is a sort of virtual circuit between the remote user and the network resource. This is a safer
configuration than a packet-filtering router because the external user never sees the IP address of the internal
network in the packets he or she receives, only the IP address of the firewall. A popular protocol for circuit-level
gateways is the SOCKS v5 protocol.
Another more advanced type of firewall is the application-level firewall (or application gateway), which is also
usually a component of a proxy server. Application gateways do not allow any packets to pass directly between
the two networks they connect. Instead, proxy applications running on the firewall computer forward requests to
services on the private network, and then forward responses to the originators on the unsecured public network.
Client-Server Architecture:
2-Tier Architecture
2-tier architecture is used to describe client/server systems where the client requests resources and the server
responds directly to the request, using its own resources. This means that the server does not call on another
application in order to provide part of the service.
The main advantages of the 2-tier model are as follows:
• Productive: many advanced tools have special optimizations that mean less effort is required when
working within the two-tier model.
• Better Re-use: Where application logic is placed solely on the server, it can be initiated from many client
applications and tools.
The main disadvantages of the 2-tier model are:
• Inability to partition application logic
• Lack of robust security
• Lack of scalability.
3-Tier Architecture:
In 3-tier architecture, there is an intermediary level(Middle-ware), meaning the architecture is generally split up
between:
1. A client, i.e. the computer, which requests the resources, equipped with a user interface (usually a web
browser) for presentation purposes
2. The application server (also called middleware), whose task it is to provide the requested resources,
but by calling on another server
3. The data server, which provides the application server with the data it requires.
The widespread use of the term 3-tier architecture also denotes the following architectures:
• Application sharing between a client, middleware and enterprise server
• Application sharing between a client, application server and enterprise database server.
The benefits of the 3-Tier model are as follows:
• Scalability: In this model the application servers (application logic) can be deployed on many machines.
The database server no longer needs connections to every client. In stead it needs to be connected with a
fewer amount of application servers.
• Data Integrity: Because of the fact that all database updates pass through the middle tier, the middle tier
can ensure that only valid data is allowed to be updated in the database thus removing the risk of data
corruption from fraud client applications.
• Security: Security is implemented in multiple levels thus making more difficult for a client to access
unauthorized data, than it would be if security was placed only on the database. Business logic is
implemented on a more secure central server, than if it was distributed across the network.
• Reduced distribution: Potential changes in the business logic can be centralized into one place.
• Hidden Database structure: The structure of the database is hidden from the caller, so a potential
enhancement of the database application ( due to a new app. Release) will be transparent from him.
Multi-Tiered Architecture
In 3-tier architecture, each server (tier 2 and 3) performs a specialized
task (a service). A server can therefore use services from other servers
in order to provide its own service. As a result, 3-tier architecture is Fig: Multitier Architecture
Distributed processing:
The distribution of applications and business logic across multiple
processing platforms. Distributed processing implies that processing will occur on more than one processor in
order for a transaction to be completed. In other words, processing is distributed across two or more machines
and the processes are most likely not running at the same time, i.e. each process performs part of an application
in a sequence. Often the data used in a distributed processing environment is also distributed across
platforms.
Distributed computing is a field of computer science that studies distributed systems. A distributed system
consists of multiple autonomous computers that communicate through a computer network. The computers
interact with each other in order to achieve a common goal. A computer program that runs in a distributed
system is called a distributed program, and distributed programming is the process of writing such
programs.
Distributed computing also refers to the use of distributed systems to solve computational problems. In
distributed computing, a problem is divided into many tasks, each of which is solved by one or more computers.
Distributed Systems:- A distributed application is designed to utilize the resources of multiple machines by
separating the processing and functionality into components that can be deployed in a wide variety of physical
configurations
Commonly implemented as N-Tier solutions, all distributed applications aim to achieve high performance,
scalability, extensibility, maintainability, security, and re-usability.
Distributed Application is a group of application made of distinct components running in separate runtime
environments, usually on different platforms connected via a network.
Distributed applications are able to concurrently serve multiple users and, depending on their design, make more
optimal use of processing resources. Typical distributed applications are two-tier (client-server), three-tier
(client-middleware-server), and multi-tier (client-multiple middleware-multiple servers).
Socket Programming:
Introduction to socket calls & operating system calls: TCP socket calls & UDP Socket calls. Sockets are the
combination of IP address plus corresponding TCP/UDP port numbers. For applications to work with TCP/IP,
Application Program Interface (API) is required. API serves as an interface between different software programs
and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and
computers.
Sockets come in two primary flavors. An active socket is connected to a remote active socket via an open data
connection. Closing the connection destroys the active sockets at each endpoint. A passive socket is not
connected, but rather awaits an incoming connection, which will spawn a new active socket.
A socket is not a port, though there is a close
relationship between them. A socket is associated
with a port, though this is a many-to-one
relationship. Each port can have a single passive
socket, awaiting incoming connections, and multiple
active sockets, each corresponding to an open
connection on the port.
--Sockets is the original networking interface,
developed by UCB for their BSD-series UNIX
operating systems.
Sockets are the combination of IP address plus
There are three types of sockets: stream, datagram, and raw, each of which represents a different type of
communications service.
Stream sockets provide reliable, connection-based communications. In connection-based communications, the
two processes must establish a logical connection with each other. A stream of bytes is then sent without errors
or duplication and is received in the order in which it was sent. Stream sockets correspond to the TCP protocol in
TCP/IP.
Datagram sockets communicate via discrete messages, called datagrams, which are sent as packets. Datagram
sockets are connectionless; that is, the communicating processes do not have a logical connection with each
other. The delivery of their data is unreliable. The datagrams can be lost or duplicated, or they may not arrive in
the order in which they were sent. Datagram sockets correspond to the UDP protocol in TCP/IP.
Raw sockets provide direct access to the lower-layer protocols, for example, IP and the Internet Control
Message Protocol (ICMP).
• socket() creates a new socket of a certain socket type, identified by an integer number, and allocates
system resources to it.
• bind() is typically used on the server side, and associates a socket with a socket address structure, i.e. a
specified local port number and IP address.
• listen() is used on the server side, and causes a bound TCP socket to enter listening state.
• connect() is used on the client side, and assigns a free local port number to a socket. In case of a TCP
socket, it causes an attempt to establish a new TCP connection.
• accept() is used on the server side. It accepts a received incoming attempt to create a new TCP
connection from the remote client, and creates a new socket associated with the socket address pair of
this connection.
• send() and recv(), or write() and read(), or recvfrom() and sendto(), are used for sending and
receiving data to/from a remote socket.
• close() causes the system to release resources allocated to a socket. In case of TCP, the connection is
terminated.
• gethostbyname() and gethostbyaddr() are used to resolve host names and addresses.
• select() is used to prune a provided list of sockets for those that are ready to read, ready to write or have
errors
• poll() is used to check on the state of a socket. The socket can be tested to see if it can be written to, read
from or has errors.
The Berkeley socket interface is defined in several header files. The names and content of these files differ
SYNOPSIS
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
Name Purpose
AF_UNIX, AF_LOCAL Local communication
AF_INET IPv4 Internet protocols
AF_INET6 IPv6 Internet protocols
The socket has the indicated type, which specifies the communication semantics. Currently defined types are:
The protocol specifies a particular protocol to be used with the socket. Normally only a single protocol
exists to support a particular socket type within a given protocol family, in which case protocol can be
specified as 0. However, it is possible that many protocols may exist, in which case a particular protocol
must be specified in this manner.
NAME
bind - bind a name to a socket
SYNOPSIS
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
DESCRIPTION
When a socket is created with socket(2), it exists in a name space (address family) but has no address
assigned to it. bind() assigns the address specified to by addr to the socket referred to by the file
descriptor sockfd. addrlen specifies the size, in bytes, of the address structure pointed to by addr.
Traditionally, this operation is called “assigning a name to a socket”.
NAME
listen - listen for connections on a socket
SYNOPSIS
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
DESCRIPTION
listen() marks the socket referred to by sockfd as a passive socket, that is, as a socket that will be used to
accept incoming connection requests using accept.