ECP Third chapter notes
ECP Third chapter notes
PROGRAMMING)
Unit 3: Introduction to Internet and Concept of Network
What Is the Internet?
The internet is a global network of interconnected computers, servers, phones, and smart
appliances that communicate with each other using the transmission control protocol (TCP)
standard to enable a fast exchange of information and files, along with other types of services.
Message: It is the data or information which needs to be transferred from one device to another
device over a computer network.
Sender: Sender is the device that has the data and needs to send the data to other device connected
to
the network.
Receiver: A receiver is the device which is expecting the data from other device on the network.
Transmission media: In order to transfer data from one device to another device we need a
transmission media such as wires, cables, radio waves etc.
Protocol: A protocol is a set of rules that are agreed by both sender and receiver, without a protocol
two devices can be connected to each other but they cannot communicate. In order to establish a
reliable communication or data sharing between two different devices we need set of rules that are
called protocol. For example, http and https are the two protocols used by web browsers to get and
post the data to internet; similarly SMTP protocol is used by email services connected to the
internet.
Features of LAN:
o The network size is small, which consists of only a few kilometres.
o The data transmission rate is high, ranging from 100 Mbps to 1000 Mbps.
o LAN is included in bus, ring, mesh and star topologies.
o Some network devices connected to the LAN will be limited.
o If more devices are added than prescribed network may fail.
Benefits of LAN:
o It offers a higher operating speed than WAN and MAN.
o It is less expensive and easy to install and maintain.
o It perfectly fulfills the requirement of a specific organization, such as an office, school, etc.
o It can be wired or wireless or a combination of both.
o It is more secure than other networks as it is a small set up that can be easily taken care of.
Functions of LAN:
o Sharing of files: It allows you to share or transfer files from one computer to another
computer within the LAN. For example, in a bank, it can be used to send a file with the details
of transactions of a customer from the server to clients.
o Sharing of printers: It also allows shared access to a printer, file servers, etc. For example,
ten computers that are connected through LAN can use a single printer, file server, fax
machine, etc.
o Sharing of Computational capabilities: It allows the clients to access to the computational
power of a server, e.g., an application server as some applications which run on clients in a
LAN may require higher computational capabilities.
o Mail and message related services: It allows sending and receiving mails between
computers of a LAN. You are required to have a mail server for this.
o Database services: It also allows storing and retrieving data with the help of a database server.
MAN is a high-speed network that spreads over a large geographical area such as a metro city or
town. It is set up by connecting lines. It can be operated by a private company local telephone
company.
MAN is ideal for the people of a relatively large area who want to share data o r
information. It provides fast communication via high-speed carriers or transmission media
such as copper, fiber optics and microwaves.
Examples of MAN:
o Cable TV Network
o Telephone service provides that provide high
o IEEE 802.16 or WiMAX
o Connected fire stations in a city
o Connected branches of a school in a city
Features of MAN:
o The size of the MAN is in the range of 5km to 50km.
o The MAN ranges from the campus to the entire city the local area networks using routers and
local telephone exchange or it may be a service provided by a company such as a want to share
data or information. It high-speed carriers or transmission media such as copper,fiber
Digital Subscriber Line), ISDN (Integrated Services Asymmetrical Digital Subscriber Line) and
more.es high-speed DSL lines nt gital The area covered byo The MAN is maintained and managed
by Users can achieve the sharing of regional resources by using MAN.
o The data transmission rates can be medium to high
Advantages of MAN:
o Less Expensive: It is less expensive to set up a MAN and to connect it to
o High Speed: The speed of data transfer is more than WAN.
o Local Emails: It can send local emails fast.
o Access to the Internet: users can have access to high
o Easy to set up: You can easily set up a MAN by connecting multiple LANs.
o High Security: It is more secure than WAN.
WAN extends over a large geographical area. It is not confined and is mainly set up by telephone
lines, fiber optic, or satellite links. It is mostly used by big organizations like banks and
multinational companies to communicate with their branches and customers across the world.
Although it is structurally terms of its range, e.g., MAN covers up to 50 Kms, whereas WAM
covers distances larger than 50 Km, e.g., 1000km or more.
A WAN works by using TCP/IP protocol in combination with networking devices such as switches
routers, firewalls, and modems. It does not connect individual computers; rather, they are designed
to link small networks like LANs and MANs to create a large network. The internet is considered
the largest WAN in the world as it connects various LANs and MANs through ISPs.
The computers are connected to the wide area network through public networks, such as
telephone systems, leased lines or satellites. The users of a WAN do not own the network
as it is a large setup connecting the remote computer systems. However, they are required
to subscribe to a service provided by a telecommunication provider to use this network.
Features of WAN:
o Has a much larger capacity.
o We can share the regional resources by using WAN.
o They have more bit-rate errors.
o The transmission delay is, and hence they need more communication speed.
Advantages of a WAN:
o Large Network Range: It spans a large geographical area of 2000 km or more, e.g.,
from one country to another countries.
o Centralized data: It allows your different office branches to use your head office
server for retrieving and sharing data. Thus, you don’t need to buy email servers,
files server and back up servers, etc.
o Get updated files and data: It provides an ideal platform for companies who need
a live server for their employees to exchange updated files within seconds.
o High bandwidth: It offers high bandwidth than a normal broadband connection.
Thus, it can increase the productivity of your company by offering uninterrupted
data transfer and communication.
o Workload Distribution: It helps distribute your workload to other locations. You
can hire employees in different countries and assign them to work from your office.
Examples of WAN:
1. Internet
2. US defense department
3. Stock exchanges network
4. Railway reservation system
5. Big Banks' cash dispensers' network
The computers are connected to the wide area network through public networks, such as telephone
systems, leased lines or satellites. The users of a WAN do not own the network as it is a large setup
connecting the remote computer systems. However, they are required to subscribe to a service
provided by a telecommunication provider to use this network.
Features of WAN:
o Has a much larger capacity.
Advantages of a WAN:
o Large Network Range: It spans a large geographical area of 2000 km or more, e.g., from one
country to another countries.
o Centralized data: It allows your different office branches to use your head office server for
retrieving and sharing data. Thus, you don’t need to buy email servers, files server and back
up servers, etc.
o Get updated files and data: It provides an ideal platform for companies who need a live
server for their employees to exchange updated files within seconds.
o High bandwidth: It offers high bandwidth than a normal broadband connection. Thus, it can
increase the productivity of your company by offering uninterrupted data transfer and
communication.
o Workload Distribution: It helps distribute your workload to other locations. You can hire
employees in different countries and assign them to work from your office.
Examples of WAN:
1. Internet
2. US defense department
3. Stock exchanges network
4. Railway reservation system
5. Big Banks' cash dispensers' network
6. Satellite systems
• PAN is relatively flexible and provides high efficiency for short network ranges.
• It needs easy setup and relatively low cost.
• It does not require frequent installations and maintenance
• It is easy and portable.
• Needs fewer technical skills to use.
❖ Topology
What is Network Topology?
Topology defines the structure of the network of how all the components are interconnected
other. There are two types of topology: physical and logical topology.
Types of Network Topology:
Physical topology is the geometric representation of all the nodes in a network. There are six
types of network topology which are Bus Topology, Ring Topology and Hybrid Topology.
1)Bus Topology:
The bus topology is designed in such a way that all the stations are connected through a single
cable known as a backbone cable.
Each node is either connected to the backbone cable by drop cable or directly connected to the
backbone cable.
When a node wants to send a message
u over the network, it puts a message over the network.
All the stations available in the network will receive the message. whether it has been
addressed or not. The bus topology is mainly used in 802.3 (Ethernet) and 802.4 standard
networks. The configuration of a bus topology is quite simpler as compared to other
topologies. The backbone cable is considered as a "single lane" through which the message is
broadcast to all the stations. The most common access method of the bus topologies is CSMA
(Carrier Sense Multiple Access).
CSMA: It is a media access control used to control the data flow so that data integrity is
maintained, i.e., the packets do not get lost. There are two alternative ways of handling the
problems that occur when two nodes send the messages simultaneously.
o CSMA CD: CSMA CD (Collision detection) is an access method used to detect the
collision. Once the collision is detected, the sender will stop transmitting the data.
Therefore, it works on "recovery after the collision".
o CSMA CA: CSMA CA (Collision Avoidance) is an access method used to avoid the
collision by checking whether the transmission media is busy or not. If busy, then
the sender waits until the media becomes idle. This technique effectively reduces the
possibility of the collision. It does not work on "recovery after the collision".
Advantages of Bus topology:
o Low-cost cable: In bus topology, nodes are directly connected to the cable without
passing through a hub. Therefore, the initial cost of installation is low.
o Moderate data speeds: Coaxial or twisted pair cables are mainly used in bus-based
networks that support upto 10 Mbps.
o Familiar technology: Bus topology is a familiar technology as the installation
and troubleshooting techniques are well known and hardware components are easily
available.
o Limited failure: A failure in one node will not have any effect on other nodes.
o Extensive cabling: A bus topology is quite simpler, but still it requires a lot of cabling.
o Difficult troubleshooting: It requires specialized test equipment to determine the
cable faults. If any fault occurs in the cable, then it would disrupt the communication
for all the nodes.
o Signal interference: If two nodes send the messages simultaneously, then the
signals of both the nodes collide with each other.
o Reconfiguration difficult: Adding new devices to the network would slow
down the network.
o Attenuation: Attenuation is a loss of signal leads to communication issues.
Repeaters are used to regenerate the signal.
2) Ring Topology:
Star topology is an arrangement of the network in which every node is connected to the
central hub, switch or a central computer The central computer is known as a server and the
peripheral devices attached to the server are known as clients. Coaxial cable or RJ-45 cables are
used to connect the computers. Hubs or Switches are mainly used as connection devices in a
physical star topology. Star topology is the most popular topology in network implementation.
Advantages of Star topology:
Efficient Troubleshooting: Troubleshooting is quite efficient in a star topology as compared
to bus topology. In a bus topology, the manager has to inspect the kil meters of cable. In a
star topology, all the stations are connected to the centralized network. Therefore, the network
administrator has to go the single station to troubleshoot the problem.
Network control: Complex network control features can be easily implemented in the star
topology. Any changes made in the star topology are automatically accommodated.
Limited failure: As each station is connected to the central hub with its own cable, therefore
failure in one cable will affect the entire network.
Familiar technology: Star topology is a familiar technology as its tools are cost-effective.
Easily expandable: It is easily expandable as new stations can be added to the open ports on
the hub.
Cost effective: Star topology networks are cost-effective as it uses inexpensive coaxial cable.
High data speeds: It support a bandwidth of approx 100Mbps. Ethernet 100BaseT is one of
the most popular Star topology networks.
4)Tree topology:
o Tree topology combines the characteristics of bus topology and star topology.
o A tree topology is a type of structure in which all the computers are connected with
each other in hierarchical fashion. The top-most node in tree topology is known
as a root node, and all other nodes are the descendants of the root node.
o There is only one path exists between two nodes for the data transmission. Thus,
it forms a parent-child hierarchy.
Support for broadband transmission: Tree topology is mainly used to provide broadband
transmission
o Easily manageable: In tree topology, the whole network is divided into segments
known as star networks which can be easily managed and maintained.
o Error detection: Error detection and error correction are very easy in a tree topology.
o Limited failure: The breakdown in one station does not affect the entire network.
o Point-to-point wiring: It has point-to-point wiring for individual segments.
Disadvantages of Tree topology:
Difficult troubleshooting: If any fault occurs in the node, then it becomes difficult to
troubleshoot the problem.
o Reconfiguration difficult: If new devices are added, then it becomes difficult to
reconfigure.
o High cost: Devices required for broadband transmission are very costly.
o Failure: A tree topology mainly relies on main bus cable and failure in main bus
cable will damage the overall network.
5)Mesh topology:
Disadvantages
• Complexity − Mesh topology is complex because every node is having a connection with
all other nodes which consumes a lot of time. In a small network, it’s okay to maintain, but
as the network size grows, the number of devices connected to it or router connected to it
grows then it would be very difficult to maintain. And keep up to date. That’s why this
method of connecting networks is comparatively complex concerning other topologies.
• High Cost − This is a measure issue of mesh topology because it costs more because it takes
all way wires one node is connected to (n-1) other nodes. An n-1 connection is required so
for n nodes n_(C_2 ) connections. This is the reason for the high cost.
• Limited scalability − Such topologies are difficult to scale when a big setup with mesh
topology is created then, to add one node we have to connect all the available nodes which
means n connections we have to make. And this cost a lot with so much effort as the network
grows.
• Redundancy − While redundancy is a key advantage of mesh topology, it can also be a
disadvantage. Mesh topology requires a larger number of connections between nodes. Which
can result in a high level of redundancy.
• Bandwidth Issues − Mesh topology can suffer from bandwidth issues. This is because data
must go through multiple nodes to reach its destination. this can result in slower network
speeds and increased congestion. However, this can be mitigated by using speed connections
between nodes and implementing quality-of-service measures to prioritize network traffic.
• One line advantages of mesh topology
Advantages of Mesh Topology
• In case of failure of a single device, the entire network didn’t break.
• There is no traffic problem as there is a dedicated point to point links for every device.
• Mesh Topology provides high privacy and security.
• Data transmission is more consistent because failure doesn’t disrupt its processes.
• Adding new devices won’t disrupt transmission of data.
Disadvantages of Mesh Topology
• Mesh Topology is costly as compared to the other network topologies i.e. star, bus, point to
point topology.
• Installation of nodes are difficult in mesh topology.
• Power requirement is higher as all the nodes will need to remain active all the time and
share the load.
• Each node requires a extra utility cost.
• More maintenance is required in mesh topology.
6)Hybrid Topology:
Introduction to TCP/IP
TCP/IP Model:
1. The TCP/IP model was developed prior to the OSI model.
2. The TCP/IP model is not exactly similar to the OSI model.
3. The TCP/IP model consists of five layers: the application layer, transport layer, network
layer, data link layer and physical layer.
4. The first four layers provide physical standards, network interface,
internetworking, and transport functions that correspond to the first four layers of the
OSI model and these four layers are represented in TCP/IP model by a single layer
called the application layer.
5. TCP/IP is a hierarchical protocol made up of interactive modules, and each of them
provides specific functionality.
Here, hierarchical means that each upper-layer protocol is supported by two or more
lower-level protocols.
Network Access Layer:
A network layer is the lowest layer of the TCP/IP model.
A network layer is the combination of the Physical layer and Data Link layer defined in the OSI
reference model
It defines how the data should be sent physically through the network.
o This layer is mainly responsible for the transmission of the data between two devices
on the same network.
o The functions carried out by this layer are encapsulating the IP datagram
into frames transmitted by the network and mapping of IP addresses into physical
addresses.
o The protocols used by this layer are ethernet, token ring, FDDI, X.25, frame relay.
Internet Layer:
▪ An internet layer is the second layer of the TCP/IP model.
▪ An internet layer is also known as the network layer.
▪ The main responsibility of the internet layer is to send the packets from any network
and they arrive at the destination irrespective of the route they take.
ICMP Protocol:
ICMP Test: ICMP Test is used to test whether the destination is reachable or not.
ICMP Reply: ICMP Reply is used to check whether the destination
device is responding or not.
❖ The core responsibility of the ICMP protocol is to report the problems, not correct
them. The responsibility of the correction lies with the sender.
❖ ICMP can send the messages only to the source, but not to the intermediate routers
because the IP datagram carries the addresses of the source and destination but not
of the router that it is passed to.
Transport Layer:
The transport layer is responsible for the reliability, flow control and correction of data which is
being sent over the network.
The two protocols used in the transport layer are User Datagram protocol and Transmission
control protocol.
TCP/IP Layer
3. Transport Layer
The TCP/IP transport layer protocols exchange data receipt acknowledgments and retransmit
missing packets to ensure that packets arrive in order and without error. End-to-end
communication is referred to as such. Transmission Control Protocol (TCP) and User Datagram
Protocol are transport layer protocols at this level (UDP).
• TCP: Applications can interact with one another using TCP as though they were
physically connected by a circuit. TCP transmits data in a way that resembles character-
by-character transmission rather than separate packets. A starting point that establishes
the connection, the whole transmission in byte order, and an ending point that closes the
connection make up this transmission.
• UDP: The datagram delivery service is provided by UDP , the other transport layer
protocol. Connections between receiving and sending hosts are not verified by UDP.
Applications that transport little amounts of data use UDP rather than TCP because it
eliminates the processes of establishing and validating connections.
4. Application Layer
This layer is analogous to the transport layer of the OSI model. It is responsible for end-to-end
communication and error-free delivery of data. It shields the upper-layer applications from the
complexities of data. The three main protocols present in this layer are:
• HTTP and HTTPS:HTTP stands for Hypertext transfer protocol. It is used by the World
Wide Web to manage communications between web browsers and servers. HTTPS stands
for HTTP-Secure. It is a combination of HTTP with SSL(Secure Socket Layer). It is
efficient in cases where the browser needs to fill out forms, sign in, authenticate, and
carry out bank transactions.
• SSH:SSH stands for Secure Shell. It is a terminal emulations software similar to Telnet.
The reason SSH is preferred is because of its ability to maintain the encrypted
connection. It sets up a secure session over a TCP/IP connection.
• NTP:NTP stands for Network Time Protocol. It is used to synchronize the clocks on our
computer to one standard time source. It is very useful in situations like bank
transactions. Assume the following situation without the presence of NTP. Suppose you
carry out a transaction, where your computer reads the time at 2:30 PM while the server
records it at 2:28 PM. The server can crash very badly if it’s out of sync.
The host-to-host layer is a layer in the OSI (Open Systems Interconnection) model that is
responsible for providing communication between hosts (computers or other devices) on a
network. It is also known as the transport layer.
Some common use cases for the host-to-host layer include:
• Reliable Data Transfer: The host-to-host layer ensures that data is transferred reliably
between hosts by using techniques like error correction and flow control. For example, if
a packet of data is lost during transmission, the host-to-host layer can request that the
packet be retransmitted to ensure that all data is received correctly.
• Segmentation and Reassembly: The host-to-host layer is responsible for breaking up
large blocks of data into smaller segments that can be transmitted over the network, and
then reassembling the data at the destination. This allows data to be transmitted more
efficiently and helps to avoid overloading the network.
• Multiplexing and Demultiplexing: The host-to-host layer is responsible for
multiplexing data from multiple sources onto a single network connection, and then
demultiplexing the data at the destination. This allows multiple devices to share the same
network connection and helps to improve the utilization of the network.
• End-to-End Communication: The host-to-host layer provides a connection-oriented
service that allows hosts to communicate with each other end-to-end, without the need for
intermediate devices to be involved in the communication.
Example: Consider a network with two hosts, A and B. Host A wants to send a file to host B.
The host-to-host layer in host A will break the file into smaller segments, add error correction
and flow control information, and then transmit the segments over the network to host B. The
host-to-host layer in host B will receive the segments, check for errors, and reassemble the file.
Once the file has been transferred successfully, the host-to-host layer in host B will acknowledge
receipt of the file to host A.
In this example, the host-to-host layer is responsible for providing a reliable connection between
host A and host B, breaking the file into smaller segments, and reassembling the segments at the
destination. It is also responsible for multiplexing and demultiplexing the data and providing
end-to-end communication between the two hosts.