CSI104 Slot06
CSI104 Slot06
CSI104 Slot06
COMPUTER
NETWORKS &
INTERNET
Tam Nguyen (FU HL- SE)
Jan 2023
CONTENT
1. Overview
• TCP/IP protocol
2. Layers in networking
3
OBJECTIVES
4
CONTENT
1. Overview
• TCP/IP protocol
2. Layers in networking
5
Introduction
• These devices in a network are connected using Figure 4.1. A simple network
wired or wireless transmission media such as cable
or air.
6
Local Area Network (LAN)
7
Wide Area Network (WAN)
LAN WAN
limited in size, spanning has a wider geographical span,
an office, a building, or a spanning a town, a state, a
campus country, or even the world
interconnects hosts interconnects connecting devices
such as switches, routers, or
modems
is normally privately is normally created and run by
owned by the organization communication companies and Figure 4.3. A WAN architecture
that uses it leased by an organization that
uses it
8
The Internet
Network Protocol
10
Protocol Layering
• A protocol defines the rules that both the sender & receiver & all intermediate devices need
to follow to be able to communicate effectively in Internet.
• A protocol is needed at each layer, or protocol layering.
• The TCP/IP (Transmission Control Protocol / Internet Protocol) is a protocol suite (a set of
protocols organized in different layers) used on the Internet today.
• It is a hierarchical protocol made up of interactive modules, each of which provides a specific
functionality.
13
Addressing and Packet Names
• Any communication that involves two parties needs source and destination addresses. There are
normally only four because the physical layer (data exchange is a bit) does not need addresses.
• There is a relationship between the layer, the address used in that layer, and the packet name
at that layer.
Figure 4.7 Addressing and packet names in the TCP/IP protocol suite 14
CONTENT
1. Overview
• TCP/IP protocol
2. Layers in networking
15
# Layer name Protocols Protocol Data Unit Addressing
16
APPLICATION
layer
5th layer of the TCP/IP protocol
17
2.1 Application layer
• Using the Internet, we need two application programs to interact with each other: one running
on a computer and the other running on another. Should both application programs be able to
request services and/or provide services?
• Two paradigms have been developed during the lifetime of the Internet to answer this question:
the client-server paradigm and the peer-to-peer paradigm
Several traditional services are still using this paradigm, including the World Wide Web
(WWW) and its vehicle HyperText Transfer Protocol (HTTP, HTTPS), file transfer protocol
(FTP), secure shell (SSH), email, and so on.
20
Uniform Resource Locator (URL)
http://www.somename.com/kidshoes/running.php?sku=123&lang=vi
protocol fully qualified domain name
192.168.1.20
5ffe:1800:4545:0005:0300:f7ff:fe20:67cf
DNS looks up a host name to find the matching IP address in a process called Name Resolution
21
DNS on the Internet
• DNS is a protocol that can be used in different platforms. The domain name space (tree) was
originally divided into three different sections: generic domains, country domains, and the
inverse domain. However, the inverse domains are now deprecated.
• Generic Domains : define registered hosts
22
TRANSPORT
layer
4th layer of the TCP/IP protocol
23
2.2 TRANSPORT LAYER
• For communication, we must define the local host (IP), local process, remote host (IP), and
remote process. To define the processes, we need second identifiers called port numbers. In
the TCP/IP protocol suite, the port numbers are integers between 0 and 65,535 (16 bits).
• The client program defines itself with an ephemeral port number that is recommended to
be greater than 1023 for some client/server programs to work properly. The server process
must also define itself with a well-known port number.
• The User Datagram Protocol (UDP) is a • Transmission Control Protocol (TCP) is a connection-
connectionless, unreliable transport protocol. oriented, reliable protocol. TCP explicitly defines
UDP is a very simple protocol using a minimum of
connection establishment, data transfer, and connection
overhead. If a process wants to send a small
message and does not care much about teardown phases to provide a connection-oriented
reliability, it can use UDP. Sending a small service. At the transport layer, TCP groups a number of
message using UDP takes much less interaction bytes together into a packet called a segment.
between the sender and receiver than using TCP.
• TCP adds a header to each segment (for control
• UDP packets, called user datagrams (format as
purposes) and delivers the segment (format as below) to
below), have a fixed-size header of 8 byte and the
total length needs to be less 65 535 bytes. the network layer for transmission. The segments are
encapsulated in an IP datagram and transmitted.
8 to 65,535 bytes
20 to 60 bytes
8 bytes
Direction of Direction of Header Data
Header Data
bit transmission bit transmission
27
NETWORK
layer
3rd layer of the TCP/IP protocol
28
2.3 NETWORK LAYER
Packetizing: encapsulating the payload (data received from upper layer) in a network-layer packet
at the source and decapsulating the payload from the network-layer packet at the destination.
1. The source network layer receives a packet from transport layer, adds a header that contains
source & destination addresses, and some other information.
2. The network layer then logically delivers the packet to the network layer protocol at the
destination.
3. The destination host receives the network-layer packet, decapsulate the payload and deliver
to the upper-layer protocol.
• The main protocol is called the Internet Protocol (IP) . IPv4 and IPv6 are in use today.
• There are three common notations to show an IP address: binary notation (base 2),
dotted-decimal notation (base 256), and hexadecimal notation (base 16).
2 3
Examine Look up IP destination
destination IP network in routing table
1 4
Receive Forward traffic to
data packet Router destination
32
DATA LINK
layer
2nd layer of the TCP/IP protocol
33
2.4 DATA-LINK LAYER
• Communication at the data-link layer is node-to-node. Data unit from one point on the
Internet needs to pass through many networks (LANs and WANs) to reach another point.
Theses LANs and WANs are connected by routers.
• It is customary to refer to the two end hosts and the routers as nodes and the networks in
between as links .
LAN
⇢ Wired LANs: Ethernet
⇢ Wireless LANs (Wi-Fi, Bluetooth)
WAN
⇢ Wired WANs (dial-up, DSL, Cable network)
⇢ Wireless WANs (WiMax, satellite network)
Figure 4.17. Nodes & Links
35
Wired LANs: Ethernet
• Ethernet LAN was developed in 1970s by Robert Metcalfe & David Boggs. Standard
Ethernet (10 Mbps), Fast Ethernet (100 Mbps), Gigabit Ethernet (1 Gbps), and 10
Gigabit Ethernet (10 Gbps).
• A frame carries some information such as the source address (48 bits), the destination
address (48 bits), the type of data, the actual data, and some other control bits as a
guard to help checking the integrity of data during transition.
Figure 4.19. the basic service set (BSS) and the extended service set (ESS). 37
Wired WANs: Cable Network
The Wireless Inter-operability for Microwave Access (WiMax) is the wireless version of DSL or
cable connection to the Internet. It provide two types of services (fixed WiMax) to connect the
main station to fixed station, or to mobile stations such as cellular phones.
40
2.5 PHYSICAL LAYER
41
Analog and Digital Transmission
Encapsulate the data. Add sequence number 1 of 3 Checksum 51 2 of 3 Checksum 598 3 of 3 Checksum 232
& error correction information to each Take pride in who you are!
packet Port 80 Port 80 Port 80
HTTP FTP SMTP POP3
• HyperText Transfer Protocol (HTTP): used to deliver multimedia rich webpages to browsers over the www
• File Transfer Protocol (FTP): used to deliver files quickly from one computer to another
• Simple Mail Transfer Protocol (SMTP): used when emails are sent between mail services
• Post Office Protocol (POP): used when we retrieve mail messages from a mail server so we can work with them locally on a pc-based
application such as outlook
• Internet Message Access Protocol (IMAP): allows us to work with mails live on the server using web mail systems (Hotmail, Gmail, etc.)
• Voice over Internet Protocol (VOIP): used to transfer voice and video data over the Internet
• User Datagram Protocol (UDP): lightweight alternative to TCP; less reliable than TCP because it doesn’t perform any of the error checking, but
it’s much faster à suitable for live video streaming, online games
• Internet Control Message Protocol (ICMP): used by routers to exchange status info & error messages (e.g. to report that a particular route that
can’t be reached)
• Address Resolution Protocol (ARP): allows one device to discover another’s MAC address if its IP address is known. Once the target network
segment has been reached, the MAC address comes into play
45