Professional Documents
Culture Documents
Network Management
TCP/IP Networking
This protocol suite consists of a large collection of protocols.
TCP/IP, the protocol on which the Internet is built, is actually not a single
protocol but rather an entire suite of related protocols.
The TCP/IP suite is based on a four-layer model of networking that is
similar to the seven-layer OSI model.
The lowest layer of the model, the Network Interface layer, corresponds to
the OSI model’s Physical and Data Link layers.
TCP/IP can run over a wide variety of Network Interface layer protocols,
including Ethernet, as well as other protocols, such as Token Ring and FDDI
(an older standard for fiber-optic networks).
Cont…
The Application layer of the TCP/IP model corresponds to the upper three layers of
the OSI model that is, the
Session,
Presentation, and
Application layers
Many protocols can be used at this level. A few of the most popular are HTTP, FTP,
Telnet, SMTP, DNS, and SNMP.
The three most important protocols in the TCP/IP suite: IP, TCP, and UDP.
The Process/Application layer defines protocols for
node-to-node application communication and also
controls user-interface specifications.
The transport (Host-to-Host) layer parallels the functions of the OSI’s Transport
layer, defining protocols for setting up the level of transmission service for
applications.
The Internet layer corresponds to the OSI’s Network layer, designating the
protocols relating to the logical transmission of packets over the entire network.
The equivalent of the Data Link and Physical layers of the OSI model, the
Network Interface (Network Access) layer oversees hardware addressing and
defines protocols for the physical transmission of data.
Protocols in Application layer
Telnet - allows a user on a remote client machine, called the Telnet client, to access the
resources of another machine, the Telnet server.
Telnet makes client machine appear as though it were a terminal directly attached to the
server.
File Transfer Protocol (FTP) - is the protocol that actually lets us transfer files, and it
can accomplish this between any two machines using it.
Usually users are subjected to authentication
Network File System (NFS) - a protocol specializing in file sharing allowing two
different types of file systems to interoperate.
Simple Mail Transfer Protocol (SMTP) - uses a spooled, or queued method of mail
delivery.
POP3 is used to receive mail
Simple Network Management Protocol (SNMP) -collects and manipulates valuable
network information.
This protocol stands as a watchdog over the network, quickly notifying managers of
any sudden turn of events.
Domain Name Service (DNS) – resolves hostnames specifically, Internet names, such
as www.u.edu.et to the IP address 172.16.16.20
Dynamic Host Configuration Protocol (DHCP) - gives IP addresses to hosts. It
allows easier administration and works well in small-to-even-very large network
environments.
Transport layer
Transmission Control Protocol (TCP) - takes large blocks of information
from an application and breaks them into segments.
It numbers and sequences each segment so that the destination’s TCP
protocol can put the segments back into the order the application
intended.
Uses three way handshaking and it is connection-oriented Protocol
User Datagram Protocol (UDP) - does not sequence the segments and
does not care in which order the segments arrive at the destination.
But after that, UDP sends the segments off and forgets about them.
It doesn’t follow through, check up on them, or even allow for an
acknowledgment of safe arrival complete abandonment.
It is connectionless Protocol
TCP for reliability and UDP for faster transfers.
Port Numbers
TCP and UDP must use port numbers to communicate with the upper layers, because
they’re what keeps track of different conversations crossing the network simultaneously.
These port numbers identify the source and destination application or process in the TCP
segment.
There are 2^16 = 65536 ports available.
Well-known ports - The port numbers range from 0 to 1023.
Registered ports - The port numbers range from 1024 to 49151.
Registered ports are used by applications or services that need to have consistent port
assignments.
Dynamic or private ports - The port numbers range from 49152 to
65535.
These ports are not assigned to any protocol or service in particular and can be used for
any service or application.
If a port is closed/blocked, you cannot communicate with the computer by the protocol
using that port.
Eg. If port 25 is blocked you cannot send mail.
Firewalls by default block all ports.
You should know the port numbers of different protocols!!
Cont…
The Internet Protocol
Internet Protocol (IP)-essentially is the Internet layer.
The other protocols found here merely exist to support it.
It can do this because all the machines on the network have a software,
or logical, address called an IP address.
IP supports the following services:
one-to-one (unicast)
one-to-all (broadcast)
one-to-several (multicast)
Have 8 bit network prefix starting with o, 7 bit network number, followed
by 24 bit host number.
A maximum of 126 (2 ^7-2) /8 networks can be defined.
All zeros (00000000) is reserved for default route, & 127 is reserved for the
“loopback” (01111111).
Each network supports a maximum of 16,777,214(2 ^ 24-2) hosts.
All zeros “for this network” and all ones for broadcast number in each
network.
IPV4 address space is 2 ^ 32 = 4,294,967,296 addresses.
Class A’s individual addresses = 2 ^ 31= 2,147,483,648 which is 50 percent
of IPV4 unicast address space.
Class B networks ( /16 )
Has 16 bit network prefix starting with 10.
14 bit network number & 16 bit host number.
A maximum of 2 ^ 14= 16,384 networks can be defined.
2 ^ 16-2= 65,534 hosts per network.
Class B individual addresses= 2 ^ 30 =1,073,741,842 .
Is 25 percent of the total IPV4 unicast address space.
Class C networks ( /24 )
Each network address has a 24 bit network prefix.
Starts with 110 and 21 bit network number.
A maximum of 2 ^ 21= 2,097,152 networks can be defined with up to 2
^ 8-2 = 254 hosts per network.
Class C’s individual addresses is 2 ^ 29 = 536,870,912.
This represents 12.5 percent of the total IPV4 unicast address spaces.
Class D address starts with 1110 (for multicast addressing purposes).
Class E address starts with 1111 (reserved for research and future use).
Dotted decimal notation
• Was devised to make Internet addresses easier for people to read and
write.
• Shorthand for IP addresses.
• Allows humans to avoid binary.
• Represents each byte in decimal separating by dots.
• Four decimal values per 32 bit addresses.
Sub netting
CIDR is a system of IP addressing and routing that solves the many problems
of classful addressing by eliminating fixed address classes in favor of a
flexible, hierarchical multiple level structure of networks of varying sizes.
Advantages of CIDR:
Efficient address space allocation
Elimination of class imbalances
Efficient routing entries
No separate subnetting method.
Since there are no address classes in CIDR, one can not tell the size of the
network ID of an address from the address alone.
IN CIDR the length of the network ID (prefix) is indicating by placing it
following a slash after the address.
This is called CIDR notation or slash notation.
Example: 184.13.152.0/22. the “22” means this network has 22 bits for the
network ID and 10 bits for host address.
Its subnet mask is 255.255.252.0 and has a total of 1022 (2 ^ 10 – 2) hosts.
Cont…
Example:
A middle size ISP has assigned an address 71.94.0.0/15, means
15 bits network ID and 17 bits host address.
It was assigned from a large size ISP
71.94.0.0/15 equals to half of the address block 71.94.0.0/14,
and a quarter of the block 71.94.0.0/13 and so on.
71.94.0.0/15 has 131,070 possible host addresses (2^17-2),
equals to 2 class B’s host addresses.
It is possible to create 2 subnets using 1 bite from the host part
= 71.94.0.0/16 and 71.95.0.0/16, each with 2^16-2 (65534)
host addresses.
Cont…
/etc/hosts
– Used for name resolution
– Should contain at least two entries
• Loopback address
• The address the local system is known
• studentgstudentServer:-S cat /etc/hosts
In Linux, /etc/hosts is a file used by the operating system to translate
hostnames to IP-addresses. It is also called the 'hosts' file.
By adding lines to this file, we can map arbitrary hostnames to arbitrary IP-
addresses, which then we can use for testing websites locally.
• On Linux, you can find the hosts file under /etc/hosts.
• Since it's a plain text file, you can open the hosts file using your preferred
text editor.
• Since the hosts file is a system file, you'll need administrative rights to save
changes.
Configuring a Linux Box as a Router
• On an IP network, two computers can communicate only if they
belong to the same IP subnet.
• If two computers belong to different IP subnets, they need a router to
connect.
• A router is a special device that not only provides IP forwarding as the
main function but also supports many other IP-based features such as;
packet filtering, voice over IP, IP firewall, etc.
• A router is an expensive device. Configuring it is also a complex task.
• If you have a Linux system and need only IP forwarding, you can use
it. Linux provides a zero-cost solution for IP forwarding.
• LAB setup
• We need a Linux system to configure the IP forwarding. We need two
more systems for testing.
• We will configure these systems in different IP subnets.
• We will use the Linux system to provide connectivity between both IP
subnets
Cont…
• Reasons
– If you tried to recompile the kernel and failed
– If one of the parameters passed to Grub is wrong
– Failing kernel module
• Upstart
– Responsible for starting the init process and associated essential
services
– Messages related to Upstart are rarely seen
– If none of the services on the server can be initialized or errors
related to init indicate a problem related to Upstart
– Make sure that /etc/envent.d is readable
Cont..
• Essential services
– Script execution
• Upstart => /etc/event.d => /etc/init.d => “/etc/runIeveI.d” => /etc/init.d (real services
that it should start)
– If one of the scripts at this stage fails, an error will be seen
– Example services
• Common problems
• Grub errors
– Grub fails to load
– Errors
• Grub is completely wiped
• Grub error message
• Missing file error
– Solutions
• Reinstall Grub
• Load Grub manually and fix errors
• Helps to see exactly where the problem occurs
– No master boot record
• If no backup of the MBR, restoring requires that you first fix your partition table and then
restore Grub
• Creating backup of MBR
• dd if=/dev/sda of=/boot/mbr backup bs=512 count=1
• Repeat this command after every change you make to the partition table or Grub code
• Restoring MBR from a backup
• dd if=/boot/mbr backup of=/dev/sda bs=512 count=1
Cont…
• Partition problems
– Two kinds of partition problems
• Complete partition table is lost
• Problem with the file system on a partition
– Complete partition table lost
• To recover a lost partition table, one needs to have
» Rescue CD
• Used to start the server
» gpart
– Used to find exact information about the beginning and end of the
partitions on the server’s hard disk
• gpart /dev/sda
– Once the beginning and end of partitions are found, use fdisk to re-
create the partitions
Cont…
• Connectivity
– Troubleshooting outgoing connections
– Scenario
• Unable to get to any website
– View network interfaces
• Use ip command to see status of network interfaces
• When the interface is up, there would be an inet line showing the
IP address of the interface
• zp Ow
• I: lo: <LOOPBAEK,UP,LOWBR_UP> mtu 16436 qdisc noqueue state
UNKNOWN link/loopback 08:O0.66:00:60:00 brd BB:00:DO:0D:00.OD
• inet 127.0.0.l/B scope ho9t lo inet6 ::l/128 scope host
• valid_lft forever preferred_lft forever
• 2. etho. MNO-CARRIBR,BROADCAST,MULTIEAST,UP> mtu 1500
state DOWN qlen 1000 link/ether f0.de:fl.ZB:46:d9 brd fI.ff:II:fE:ff:ff