0% found this document useful (0 votes)
3 views

Week 5 - Lecture Notes

Uploaded by

siennachang1202
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Week 5 - Lecture Notes

Uploaded by

siennachang1202
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Module Title:

Computer
Networks
Module Code: COM5014M
Level: 5
Credits: 20
Week 5

IP Addressing &
Subnetting &
TCP/IP Protocols
ICANN/IANA (Internet Assigned Number Authority)
• Many countries, machines, and organizations are connected to the Internet, using IP
addresses.
• As IP address for each machine should be unique all over the globe, it should be
managed uniformly.
• ICANN ’s (Internet Corporation for Assigned Names and Numbers) primary role is to
manage Internet resources, coordinates the allocation and assignment of:
o Domain names system (DNS)
o IP addresses and Autonomous System (AS) numbers
o Protocol port and parameter numbers
• Public IP's must be purchased before use through your Internet Service Provider.
Source: http://www.icann.org/
ICANN/IANA Structure

Source: http://www.icann.org/
Regional Internet Registries (RIRs)
• ICANN has delegated the distribution of IP addresses to the Regional Internet
Registries (RIR).
• There are five RIRs.

• Each RIR manages ranges of addresses:


http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml
Private IP Addresses
• The global shortage of IPv4 addresses is a real problem.
• Private IP addressing was originally conceived to address this problem.
• That means that anyone can assign and use this block of reserved IP addresses on
his/her network without the need to register them with the IANA.

Class From TO Default Subnet Maek

A 10.0.0.0 10.255.255.255 255.0.0.0

B 172.16.0.0 172.31.255.255 255.255..0.0

C 192.168.0.0 192.168.255.255 255.255.255.0


Specialised IP Addresses
• Loopback addresses (127.x.x.x range)
o Refers to the device itself and used for testing
o Most commonly used as 127.0.0.1
• Automatic Private IP Addresses (APIPA)
o Dynamically assigned by OS when DHCP server is unavailable, and address not
assigned manually.
o Range of 169.254.x.x

Class From TO Subnet Maek

Loopback IP A 127.0.0.1 127.255.255.255 255.0.0.0


APIPA B 169.254.0.0 169.254.255.255 255.255..0.0
Assigning IP Addresses
• Static
o Simple
o Time-consuming
o Prone to human errors
o Impractical for large networks
• Dynamic
o Quicker
o Easier
o Less confusing
o Simplistic for large networks
Subnetting Purpose
• Default classful subnet masks are rarely the optimal choice for a subnet size.
• Subnets can be modified using subnet masks to create networks that are better scoped.
• More efficient use of IP addresses than classful default.
• Enables separation of networks for security.
• Enables bandwidth control.
• Creating a subnet involves
borrowing bits from the original
host portion and adding them
to the network portion
Subnetting Notation

Classful
Subnets

Classless
Subnets
Subnetting: Classful vs Classless
• Classful subnet 192.168.1.0/24
• 1 networks = 20 where 0 is the number of borrowed bits. Meaning 0 subnet.
• 256 IP addresses = 28 where 8 where s is the number of borrowed bits

• Classless subnet 192.168.1.64/26


• 4 networks = 22
• 64 IP addresses = 26
Subnetting Formula
• Number of assignable IP addresses

Class Default Subnet Maek Assignable IP

A 255.0.0.0 224 - 2 = 16,777,214


B 255.255..0.0 216 - 2 = 65,534
C 255.255.255.0 28 - 2 = 254

• Number of Created Subnets is 2s where s is the number of borrowed bits


• Number of assignable IP addresses 2h − 2 where h is the number of host bits
Calculating Number of Subnets
• Calculate the number of subnets and IP addresses for host for 192.168.1.64/26
• Default mask is /24, so /26 means we borrowed 2 bits from host space for subnets.
• Calculation Formula:
• Total number of subnets 22 = 4
• Total number of bits: 32 Total number of host bits 32 – 26 = 6
• Number of assignable IP addresses 2h − 2 where h is the number of host bits
• 26 − 2 = 62 62 assignable IP addresses in each subnet

The "−2" at the end of the formula is because the first and last IP
addresses in each subnet are reserved, one for the Network
ID and one for the Broadcast Address.
Calculating Number of Subnets
• Subnets and IP ranges for 192.168.1.64/26

IP Range Subnets
First IP Last IP
Subnet 1 192.168.1.0 192.168.1.63
Subnet 2 192.168.1.64 192.168.1.127
Subnet 3 192.168.1.128 192.168.1.191
Subnet 4 192.168.1.192 192.168.1.255

• Network IDs: First IP of each subnet is considered as network ID for that subnet
• Broadcast ID: last IP of each subnet is considered as network ID for that subnet
Subnetting Scenario
• The company needs 20 offices with 5 users in each office.

20 subnets
5 hosts per subnet
Class C address: 192.168.1.0

192.168.1.16
Other
subnets

192.168.1.32 192.168.1.48
Subnetting Scenario
IP Host Address: 192.168.5.121
Subnet Mask: 255.255.255.248
Network Network Network Subnet Host

192.168.1.121: 11000000 10101000 00000001 01111001


255.255.255.248: 11111111 11111111 11111111 11111000

Subnet: 11000000 10101000 00000001 01111000


Broadcast: 11000000 10101000 00000001 01111111

• Subnet Address = 192.168.1.120


• Host Addresses = 192.168.1.121–192.168.1.126
• Broadcast Address = 192.168.1.127
• Five Bits of Subnetting
Transmission Control Protocol (TCP)
• TCP is a connection-oriented protocol, meaning that one program is connected
to another program.
• TCP establishes a session between source and destination, before exchanging
the data between them.
• The established session is used to ensures delivery of packets between source
and destination hence it is called a reliable protocol.
• TCP includes several mechanisms to ensure reliable communication.
• TCP asks for acknowledgement (ACK) from the receiver for every segment, so
it can detect if a packet is lost. [Timing for ACK]
Transmission Control Protocol (TCP)
• TCP can detect The
o Lost packets,
o Out of order packets,
o Duplicate packets, and
o Corrupted packets.

• The main downsides of TCP is that it is the latency, as the connection need to
be established before sending the packet out.
User Datagram Protocol (UDP)
• UDP is a connectionless protocol.
• UDP is simple but fast protocol, as it doesn’t need to establish a connection before
sending data, and there is no mechanism for congestion control.
• UDP is unreliable protocol and there is no guarantee that the packet arrives to its
destination.
• This protocol is suitable for low-latency and loss-tolerating applications.
• Time-sensitive and real-time applications like online games often use UDP.
TCP v.s. UDP
TCP UDP

Reliability Higher Lower

Establishes a connection Yes No

Speed Slower Faster

Order of data delivery Guaranteed No guarantee

Data transfer type Delivers data in a sequence Delivers data in a stream

Error detection & correction Yes No


Application Layer Protocols
• The application layer in TCP/IP is equivalent to the combined session, presentation
and application layers in the OSI model

SMTP POP3

HTTP IPAM

FTP SSL
Hypertext Transfer Protocol (HTTP)
• HTTP is the core protocol for the World Wide Web (WWW) and the foundation of any
data exchange on the Web.
• HTTP is a protocol for fetching resources such as HTML documents. It was designed
for communication between web browsers and web servers.
• It is based on client-server architecture model, which define:
o the data that a client should send to a Web server to request services,
o the meaning of received data,
o the data that a Web server should send to the client, such that it can understand.
• The client uses Uniform Resource Identifier (URL).
HTTP Request and Response
• A typical flow over HTTP involves client & server communications (message exchange).
• The messages sent by the client are called requests
• The messages sent by the server as an answer are called responses.

HTTP uses the services of TCP on port number 80.


HTTP Request and Response
• Request and response messages
HTTP Request Methods
• HTTP utilizes specific request methods in order to perform various tasks.
• All HTTP servers use two of the most common HTTP methods are ‘GET’ and ‘POST’.
• A ‘GET’ request expects information back in return (usually in the form of a website).
• A ‘POST’ request typically indicates that the client is submitting information to the
web server, such as form information, e.g., a submitted username and password.
• Other HTTP Methods:
o PUT o OPTIONS
o HEAD o CONNECT
o DELETE o TRACE
o PATCH
HTTP Request Header
• Each HTTP request made across the Internet carries with it a series of encoded data
that carries different types of information.
• A typical HTTP request contains:
1. HTTP version type
2. a URL
3. an HTTP method
4. HTTP request headers
5. Optional HTTP body. GET /somedir/page.html HTTP/1.1
Host: www.yorksj.ac.uk
• Example of HTTP request headers: User-agent: Mozilla/4.0
Connection: close
Accept-language:En
HTTP Response
• An HTTP response is what web clients (often browsers) receive from a server in answer
to an HTTP request.
• These responses communicate valuable information based on what was asked for in the
HTTP request.
• A typical HTTP response contains:
o an HTTP status code
o HTTP response headers
o optional HTTP body
HTTP Response
• Like an HTTP request, an HTTP response HTTP/1.1 200 OK
comes with headers that convey Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
important information such as the
Server: Apache/1.3.0 (Unix)
language and format of the data being Last-Modified: Mon, 22 Jun 1998 …...
sent in the response body. Content-Length: 6821
Content-Type: text/html
• Successful HTTP responses to ‘GET’
requests generally have a body which data data data data data ...
contains the requested information.
o In most web requests, this is HTML
data that a web browser will
translate into a webpage
File Transfer Protocol (FTP)
• FTP is a standard protocol on TCP/IP, used to transfer files over the Internet.
• The most common, simplest, and secure protocol for file exchange over the Internet.
• FTP is a client-server architecture, uses TCP between client and server.
• FTP Client: Software that connects a computer to FTP server to access files.
• FTP Server: Stores all the files and databases for FTP clients.
• FTP server port: 21
• FTP Clients software: FTP file transfer
FTP FTP
FileZilla, Fire FTP, user
client server
Winscp interface
user
at host remote
local file file
system system
Simple Mail Transfer Protocol (SMTP)
• SMTP is the standard e-mail protocol on Internet and part of TCP/IP protocol suite.
• It defines the message format which stores and forward the mail.
• It is a relatively simple, text-based protocol, where one or more recipients of a
message are specified and then the message text is transferred.
• SMTP does not require authentication. This allows anyone on the Internet to send
email to anyone else.
• The primary purpose of SMTP is to transfer email between mail servers.
• To send email, the client sends the message to an outgoing mail server, which in turn
contact the destination mail server for delivery.
• To be able to do this, it is necessary to specify an SMTP server when configuring an
email client.
Post Office Protocol (POP3)
• POP3 is a protocol used by clients to retrieve emails from an email server over a
TCP/IP connection. It is 3rd version of POP.
• Clients use an email application to download their mailbox from email server.
• Once a client downloaded its own emails, they will be usually deleted from the server.
However, some clients allow email server to keep a copy of them.
• Microsoft Outlook is one of the popular email application who work with POP3.
• Advantages:
o As emails are downloaded to the client’s computer, all messages can be read
when user is offline.
o Easy to configure and use.
• Disadvantages:
o Email are stored on client’s computer, in case of crush, all emails may be lost.
Secure Sockets Layer (SSL)
• SSL is a method for providing security for web-based applications and between a
client and a server.
o Example: a web browser and a web server (website), a client and a mail server.
• Integration of HTTP and SSL provides security for websites.
• The SSL-secured websites begin with HTTPS (with S at HTTP).
• SSL use encryption and authentication mechanisms to ensures reliable
(confidentiality & integrity,) link between a client and a web server.
• SSL authenticate both sides of communication using SSL certificate.
• SSL Certificate has a pair cryptographic key, called Public Key, which use for encrypted
connection establishment.
Internet Protocol Address Management
• IP Address Management (IPAM) is a network service for planning, tracking, and
managing the IP addresses in a network.
• Managing IP addresses means:
o Assigning IP addresses to devices,
o changing IP addresses,
o deleting IP addresses when devices leave the network,
o dealing with conflict IP addresses, setting up subnets and designating addresses
for use by certain applications or clouds.
• Why IPAM is needed?
o In a large network with hundreds or thousands of devices, keeping track of each
of IP address becomes very difficult.
Thank You
Hamidreza Bagheri
[email protected]

You might also like