Professional Documents
Culture Documents
Unit I - NAL
Unit I - NAL
INTRODUCTION TO NETWORK
Definition
A computer network is a system in which multiple computers are connected to each other to
share information and resources.
o Computer Network is a group of computers connected with each other through wires,
optical fibres or optical links so that various devices can interact with each other
through a network.
o The aim of the computer network is the sharing of resources among various devices.
o In the case of computer network technology, there are several types of networks that
vary from simple to complex level.
HISTORY OF NETWORKS
ARPANET - the First Network
ARPANET − Advanced Research Projects Agency Network − the granddad of Internet was a
network established by the US Department of Defense (DOD).
The work for establishing the network started in the early 1960s and DOD sponsored major
research work, which resulted in development on initial protocols, languages and frameworks
for network communication.
It had four nodes at University of California at Los Angeles (UCLA), Stanford Research
Institute (SRI), University of California at Santa Barbara (UCSB) and University of Utah. On
October 29, 1969, the first message was exchanged between UCLA and SRI. E-mail was
created by Roy Tomlinson in 1972 at Bolt Beranek and Newman, Inc. (BBN) after UCLA was
connected to BBN.
Internet
ARPANET expanded to connect DOD with those universities of the US that were carrying
out defense-related research. It covered most of the major universities across the country.
The concept of networking got a boost when University College of London (UK) and Royal
Radar Network (Norway) connected to the ARPANET and a network of networks was formed.
The term Internet was coined by Vinton Cerf,
Yogen Dalal and Carl Sunshine of Stanford University to describe this network of networks.
Together they also developed protocols to facilitate information exchange over the Internet.
Transmission Control Protocol (TCP) still forms the backbone of networking.
Telenet
Telenet was the first commercial adaptation of ARPANET introduced in 1974. With this the
concept of Internet Service Provider (ISP) was also introduced. The main function of an ISP
is to provide uninterrupted Internet connection to its customers at affordable rates.
World Wide Web is a complex web of websites and web pages connected together through
hypertexts. Hypertext is a word or group of words linking to another web page of the same
or different website. When the hypertext is clicked, another web page opens.
The evolution from ARPANET to WWW was possible due to many new achievements by
researchers and computer scientists all over the world. Here are some of those developments
−
Year Milestone
ARPANET decommissioned
1990 First web browser Nexus developed
HTML developed
TCP/IP Networks
TCP/IP REFERENCE MODEL
TCP/IP Reference Model is a four-layered suite of communication protocols. It was
developed by the DoD (Department of Defence) in the 1960s. It is named after the two
main protocols that are used in the model, namely, TCP and IP. TCP stands for Transmission
Control Protocol and IP stands for Internet Protocol.
The four layers in the TCP/IP protocol suite are −
Host-to- Network Layer −It is the lowest layer that is concerned with the
physical transmission of data. TCP/IP does not specifically define any protocol
here but supports all the standard protocols.
Internet Layer −It defines the protocols for logical transmission of data over
the network. The main protocol in this layer is Internet Protocol (IP) and it is
supported by the protocols ICMP, IGMP, RARP, and ARP.
Transport Layer − It is responsible for error-free end-to-end delivery of data.
The protocols defined here are Transmission Control Protocol (TCP) and User
Datagram Protocol (UDP).
Application Layer − This is the topmost layer and defines the interface of host
programs with the transport layer services. This layer includes all high-level
protocols like Telnet, DNS, HTTP, FTP, SMTP, etc.
The following diagram shows the layers and the protocols in each of the layers −
Ethernets
What is Ethernet?
Ethernet is a type of communication protocol that is created at Xerox PARC in 1973 by
Robert Metcalfe and others, which connects computers on a network over a wired connection.
It is a widely used LAN protocol, which is also known as Alto Aloha Network.
It connects computers within the local area network and wide area network. Numerous
devices like printers and laptops can be connected by LAN and WAN within buildings, homes,
and even small neighborhoods.
It offers a simple user interface that helps to connect various devices easily, such as
switches, routers, and computers.
A local area network (LAN) can be created with the help of a single router and a few
Ethernet cables, which enable communication between all linked devices.
This is because an Ethernet port is included in your laptop in which one end of a cable is
plugged in and connect the other to a router. Ethernet ports are slightly wider, and they look
similar to telephone jacks.
With lower-speed Ethernet cables and devices, most of the Ethernet devices are backward
compatible. However, the speed of the connection will be as fast as the lowest common
denominator. For instance, the computer will only have the potential to forward and receive
data at 10 Mbps if you attach a computer with a 10BASE-T NIC to a 100BASE-T network.
Also, the maximum data transfer rate will be 100 Mbps if you have a Gigabit Ethernet router
and use it to connect the device.
The wireless networks replaced Ethernet in many areas; however, Ethernet is still more
common for wired networking. Wi-Fi reduces the need for cabling as it allows the users to
connect smartphones or laptops to a network without the required cable.
While comparing with Gigabit Ethernet, the faster maximum data transfer rates are provided
by the 802.11ac Wi-Fi standard. Still, as compared to a wireless network, wired connections
are more secure and are less prone to interference.
This is the main reason to still use Ethernet by many businesses and organizations.
The main functionality of the TCP is to take the data from the application layer. Then it
divides the data into a several packets, provides numbering to these packets, and finally
transmits these packets to the destination.
The TCP, on the other side, will reassemble the packets and transmits them to the application
layer. As we know that TCP is a connection-oriented protocol, so the connection will remain
established until the communication is not completed between the sender and the receiver.
Features of TCP protocol
The following are the features of a TCP protocol:
ADVERTISEMENT
o Transport Layer Protocol
TCP is a transport layer protocol as it is used in transmitting the data from the sender to the
receiver.
o Reliable
TCP is a reliable protocol as it follows the flow and error control mechanism. It also supports
the acknowledgment mechanism, which checks the state and sound arrival of the data. In the
acknowledgment mechanism, the receiver sends either positive or negative acknowledgment
to the sender so that the sender can get to know whether the data packet has been received
or needs to resend.
o Order of the data is maintained
This protocol ensures that the data reaches the intended receiver in the same order in which
it is sent. It orders and numbers each segment so that the TCP layer on the destination side
can reassemble them based on their ordering.
o Connection-oriented
It is a connection-oriented service that means the data exchange occurs only after the
connection establishment. When the data transfer is completed, then the connection will get
terminated.
o Full duplex
It is a full-duplex means that the data can transfer in both directions at the same time.
o Stream-oriented
TCP is a stream-oriented protocol as it allows the sender to send the data in the form of a
stream of bytes and also allows the receiver to accept the data in the form of a stream of
bytes. TCP creates an environment in which both the sender and receiver are connected by an
imaginary tube known as a virtual circuit. This virtual circuit carries the stream of bytes
across the internet.
Advantages of TCP
o It provides a connection-oriented reliable service, which means that it guarantees the
delivery of data packets. If the data packet is lost across the network, then the TCP
will resend the lost packets.
o It provides a flow control mechanism using a sliding window protocol.
o It provides error detection by using checksum and error control by using Go Back or
ARP protocol.
o It eliminates the congestion by using a network congestion avoidance algorithm that
includes various schemes such as additive increase/multiplicative decrease (AIMD),
slow start, and congestion window.
Disadvantage of TCP
It increases a large amount of overhead as each segment gets its own TCP header, so
fragmentation by the router increases the overhead.
TCP Header Format
o Source port: It defines the port of the application, which is sending the data. So, this
field contains the source port address, which is 16 bits.
o Destination port: It defines the port of the application on the receiving side. So, this
field contains the destination port address, which is 16 bits.
o Sequence number: This field contains the sequence number of data bytes in a
particular session.
o Acknowledgment number: When the ACK flag is set, then this contains the next
sequence number of the data byte and works as an acknowledgment for the previous
data received. For example, if the receiver receives the segment number 'x', then it
responds 'x+1' as an acknowledgment number.
o HLEN: It specifies the length of the header indicated by the 4-byte words in the
header. The size of the header lies between 20 and 60 bytes. Therefore, the value of
this field would lie between 5 and 15.
o Reserved: It is a 4-bit field reserved for future use, and by default, all are set to
zero.
o Flags
There are six control bits or flags:
1. URG: It represents an urgent pointer. If it is set, then the data is processed
urgently.
2. ACK: If the ACK is set to 0, then it means that the data packet does not contain
an acknowledgment.
3. PSH: If this field is set, then it requests the receiving device to push the data
to the receiving application without buffering it.
4. RST: If it is set, then it requests to restart a connection.
5. SYN: It is used to establish a connection between the hosts.
6. FIN: It is used to release a connection, and no further data exchange will
happen.
o Window sizeIt is a 16-bit field. It contains the size of data that the receiver can
accept. This field is used for the flow control between the sender and receiver and
also determines the amount of buffer allocated by the receiver for a segment. The
value of this field is determined by the receiver.
o ChecksumIt is a 16-bit field. This field is optional in UDP, but in the case of TCP/IP,
this field is mandatory.
o Urgent pointerIt is a pointer that points to the urgent data byte if the URG flag is set
to 1. It defines a value that will be added to the sequence number to get the sequence
number of the last urgent byte.
o Options
It provides additional options. The optional field is represented in 32-bits. If this field
contains the data less than 32-bit, then padding is required to obtain the remaining
bits
Features
UDP is used when acknowledgement of data does not hold any significance.
UDP is good protocol for data flowing in one direction.
UDP is simple and suitable for query based communications.
UDP is not connection oriented.
UDP does not provide congestion control mechanism.
UDP does not guarantee ordered delivery of data.
UDP is stateless.
UDP is suitable protocol for streaming applications such as VoIP, multimedia streaming.
UDP Header Format
In UDP, the header size is 8 bytes, and the packet size is upto 65,535 bytes. But this packet
size is not possible as the data needs to be encapsulated in the IP datagram, and an IP
packet, the header size can be 20 bytes; therefore, the maximum of UDP would be 65,535
minus 20. The size of the data that the UDP packet can carry would be 65,535 minus 28 as 8
bytes for the header of the UDP packet and 20 bytes for IP header.
More on Ports
Ports are assigned by computer i.e. operating system to different applications. Ports
help computer to differentiate between incoming and outgoing traffic. Since the port is
a 16-bit unsigned number it ranges from 0 to 65535.
Types of Ports
Ports are further divided into three categories:
Well Known Port
Registered port
Dynamic Port
Well Known Port
It is from the range 0 to 1023
It is reserved for common and specifically used service
It is used by some widely adopted protocols and services like HTTP(port 80),
FTP(port 21), DNS(Port 53), SSH(port 22), etc…..
Registered Port
It is from range 1024 to 49151
These are used by applications or services that are not as common
But it is used by those applications or services which require its specific port
Organizations can ask IANA(Internet Assigned Number Authority) for any
specific port number within this range
Dynamic Port
It is from range 49152 to 65535
It is also known as Ephemeral or Private Port
It is used for those connections that are temporary or short-lived
It is not registered or assigned and can be used by any process
Importance of Ports
Ports have many significance. Some of them are-
Identification of service- Different application/services that work on the same
device can be differentiated by their port numbers. For example, HTTP(Port
number 80) and SMTP(port number 25) in the same computer uses different port
number to ensure their data goes to the correct service
Efficient Data Routing- When a network device receives data from different
places it uses port numbers to efficiently route those data packets to the
respective application
Block traffic from specific applications/services- When we have to block
incoming or outgoing traffic from a specific application/service then we need to
install a firewall and specify the port number of that application/service. We
block traffic from/to some specific applications/services when we find any
potential threats from those applications/services
Scalability of services- Many services can run simultaneously on the same device
and can be differentiated using their port number. This helps the device to scale
and support many services at the same time.
Types of Sockets : There are two types of Sockets: the datagram socket and
the stream socket.
1. Datagram Socket : This is a type of network which has connection less point for
sending and receiving packets. It is similar to mailbox. The letters (data) posted
into the box are collected and delivered (transmitted) to a letterbox (receiving
socket).
2. Stream Socket In Computer operating system, a stream socket is type
of interprocess communications socket or network socket which provides a
connection-oriented, sequenced, and unique flow of data without record
boundaries with well defined mechanisms for creating and destroying connections
and for detecting errors. It is similar to phone. A connection is established
between the phones (two ends) and a conversation (transfer of data) takes place.
Function Call Description
Socket() To create a socket
Bind() It’s a socket identification like a telephone number to contact
Listen() Ready to receive a connection
Connect() Ready to act as a sender
Accept() Confirmation, it is like accepting to receive a call from a sender
Write() To send data
Read() To receive data
Close() To close a connection
UUCP Network
UUCP (Unix-to-Unix Copy)[1] is a suite of computer programs and protocols allowing remote
execution of commands and transfer of files, email and netnews between computers.
A command named uucp is one of the programs in the suite; it provides a user interface for
requesting file copy operations. The UUCP suite also includes uux (user interface for remote
command execution), uucico (the communication program that performs the file
transfers), uustat (reports statistics on recent activity), uuxqt (execute commands sent
from remote machines), and uuname (reports the UUCP name of the local system). Some
versions of the suite include uuencode / uudecode (convert 8-bit binary files to 7-bit text
format and vice versa.
Linux Networking
Linux Networking Commands
Every computer is connected to some other computer through a network whether internally
or externally to exchange some information. This network can be small as some computers
connected in your home or office, or can be large or complicated as in large University or the
entire Internet.
Maintaining a system's network is a task of System/Network administrator. Their task
includes network configuration and troubleshooting.
Here is a list of Networking and Troubleshooting commands:
ifconfig Display and manipulate route and network interfaces.
ip It is a replacement of ifconfig command.
traceroute Network troubleshooting utility.
tracepath Similar to traceroute but doesn't require root privileges.
ping To check connectivity between two nodes.
netstat Display connection information.
ss It is a replacement of netstat.
dig Query DNS related information.
nslookup Find DNS related query.
route Shows and manipulate IP routing table.
host Performs DNS lookups.
arp View or add contents of the kernel's ARP table.
iwconfig Used to configure wireless network interface.
hostname To identify a network name.
curl or wget To download a file from internet.
mtr Combines ping and tracepath into a single command.
whois Will tell you about the website's whois.
ifplugstatus Tells whether a cable is plugged in or not.
System Security
The process of ensuring OS availability, confidentiality, integrity is known as operating
system security. OS security refers to the processes or measures taken to protect the
operating system from dangers, including viruses, worms, malware, and remote hacker
intrusions. Operating system security comprises all preventive-control procedures that
protect any system assets that could be stolen, modified, or deleted if OS security is
breached.
Security refers to providing safety for computer system resources like software, CPU,
memory, disks, etc. It can protect against all threats, including viruses and unauthorized
access. It can be enforced by assuring the operating system's integrity, confidentiality,
and availability. If an illegal user runs a computer application, the computer or data stored
may be seriously damaged.
System security may be threatened through two violations, and these are as follows:
1. Threat
A program that has the potential to harm the system seriously.
2. Attack
A breach of security that allows unauthorized access to a resource.
There are two types of security breaches that can harm the system: malicious and accidental.
Malicious threats are a type of destructive computer code or web script that is designed to
cause system vulnerabilities that lead to back doors and security breaches. On the other
hand, Accidental Threats are comparatively easier to protect against.
Security may be compromised through the breaches. Some of the breaches are as follows:
1. Breach of integrity
This violation has unauthorized data modification.
2. Theft of service
It involves the unauthorized use of resources.
3. Breach of confidentiality
It involves the unauthorized reading of data.
4. Breach of availability
It involves the unauthorized destruction of data.
5. Denial of service
It includes preventing legitimate use of the system. Some attacks may be accidental.
The goal of Security System
There are several goals of system security. Some of them are as follows:
1. Integrity
Unauthorized users must not be allowed to access the system's objects, and users with
insufficient rights should not modify the system's critical files and resources.
2. Secrecy
The system's objects must only be available to a small number of authorized users. The
system files should not be accessible to everyone.
3. Availability
All system resources must be accessible to all authorized users, i.e., no single user/process
should be able to consume all system resources. If such a situation arises, service denial may
occur. In this case, malware may restrict system resources and preventing legitimate
processes from accessing them.