FCI IT Is NetworkPrograming Hala Ahmed Week 03 Lec
FCI IT Is NetworkPrograming Hala Ahmed Week 03 Lec
4
Network Reference Models.
➢ In order to reduce design complexity and allow for a better standardization
process,
❑ Network protocols are organized in layers (or levels),
❑ Each layer providing a set of services to the layer immediately above and relying
on services from the layer below.
❑ The layered network architecture is organized in reference models; among these
the most well known are the ISO Open System Interconnection (OSI) reference
model and the TCP/IP reference model.
5
Outline
➢ Network Reference Models.
❑ ISO Model
❑ TCP/IP Model
➢ Services:
❑ Electronic Mail.
❑ The World Wide Web.
❑ Multimedia–Based Services.
6
Network Reference Models(ISO Model)
➢ The OSI model is a theoretical model, and the protocols associated with its layers are
rarely used.
➢ However, the model itself is widely used to present the concepts used in networking.
➢ The OSI reference model includes seven layers:
1. Physical,
2. Data Link,
3. Network,
4. Transport,
5. Session,
7
6. Presentation,
7. And Application.
Network Reference Models(ISO Model)
Application Layer – Layer 1
❑ At the very top of the OSI Reference Model stack of layers, we find the Application
layer which is implemented by the network applications.
❑ These applications produce the data, which has to be transferred over the network.
❑ This layer also serves as a window for the application services to access the
network and for displaying the received information to the user.
8
Network Reference Models(ISO Model)
Functions of the Application Layer: The main functions of application layer are given
below.
❑ Network Virtual Terminal: It allows a user to log on to a remote host.
❑ FTAM- File transfer access and management : This application allows a user to
access file in a remote host, retrieve files in remote host and manage or
control files from a remote computer.
❑ Mail Services : Provide email service.
❑ Directory Services : This application provides distributed database sources
and access for global information about various objects and services.
Note: OSI model acts as a reference model and is not implemented on the Internet
because of its late invention. The current model being used is the TCP/IP model. 9
Network Reference Models(ISO Model)
Presentation Layer – Layer 2
➢ The presentation layer is also called the Translation layer. The data from the application
layer is extracted here and manipulated as per the required format to transmit over the
network.
➢ The Functions of the Presentation Layer:
❑Translation
❑Encryption/ Decryption: Data encryption translates the data into another form or code.
The encrypted data is known as the ciphertext and the decrypted data is known as plain
text. A key value is used for encrypting as well as decrypting data.
❑Compression: Reduces the number of bits that need to be transmitted on the network.
Note: Device or Protocol Use : JPEG, MPEG, GIF
10
Network Reference Models(ISO Model)
Session Layer – Layer 3
This layer is responsible for the establishment of connection, maintenance of sessions, and
authentication, and also ensures security.
Functions of the Session Layer
❑ Session establishment, maintenance, and termination: The layer allows the two processes to
establish, use and terminate a connection.
❑ Synchronization: This layer allows a process to add checkpoints that are considered
synchronization points in the data. These synchronization points help to identify the error so that
the data is re-synchronized properly, and ends of the messages are not cut prematurely and data
loss is avoided.
❑ Dialog Controller(Transmission mode): The session layer allows two systems to start
11
communication with each other in half-duplex or full-duplex.
Network Reference Models(ISO Model)
Note:
1. All the below 3 layers(including Session Layer) are integrated as a single layer in
the TCP/IP model as the application Layer”.
2. Implementation of these 3 layers is done by the network application itself. These are
also known as Upper Layers or Software Layers.
12
Network Reference Models(ISO Model)
Transport Layer – Layer 4
➢ The transport layer provides services to the application layer and takes services from the network
layer. The data in the transport layer is referred to as Segments.
❑ It is responsible for the End to End Delivery of the complete message. The transport layer also
provides the acknowledgment of the successful data transmission and re-transmits the data if an
error is found.
❑ At the sender’s side: The transport layer receives the formatted data from the upper layers,
❖performs Segmentation,
❖and also implements Flow & Error control to ensure proper data transmission.
❖It also adds Source and Destination port numbers in its header and forwards the
segmented data to the Network Layer. 13
Network Reference Models(ISO Model)
Functions of the Transport Layer
❑ Segmentation and Reassembly: This layer accepts the message from the (session)
layer, and breaks the message into smaller units. Each of the segments produced has a
header associated with it. The transport layer at the destination station reassembles the
message.
❑ Service Point Addressing: To deliver the message to the correct process, the transport
layer header includes a type of address called service point address or port address.
Thus by specifying this address, the transport layer makes sure that the message is
delivered to the correct process.
Services Provided by Transport Layer
1.Connection-Oriented Service
2.Connectionless Service 14
Network Reference Models(ISO Model)
1. Connection-Oriented Service: It is a 2. Connectionless service: It is a one-phase process and
three-phase process that includes includes Data Transfer.
1. Connection Establishment In this type of transmission, the receiver does not
2. Data Transfer acknowledge receipt of a packet. This approach allows for
3. Termination/disconnection much faster communication between devices. Connection-
In this type of transmission, the receiving oriented service is more reliable than connectionless
device sends an acknowledgment, back to the Service.
source after a packet or group of packets is Note:
received. This type of transmission is reliable 1. Data in the Transport Layer is called Segments.
and secure. 2. Transport layer is operated by the Operating System. It is
a part of the OS and communicates with the Application
Layer by making system calls.
3. The transport layer is called as Heart of the OSI model.
4. Device or Protocol Use : TCP, UDP 15
Network Reference Models(ISO Model)
16
Network Reference Models(ISO Model)
Functions of the Network Layer
❑ Routing: The network layer protocols determine which route is suitable from source
to destination. This function of the network layer is known as routing like (RIP,
OSPF).
❑ Logical Addressing: To identify each device on Internetwork uniquely, the network
layer defines an addressing scheme. The sender & receiver’s IP addresses are placed
in the header by the network layer. Such an address distinguishes each device
uniquely and universally.
Note:
1. Segment in the Network layer is referred to as Packet.
2. Network layer is implemented by networking devices such as routers and switches.
17
Network Reference Models(ISO Model)
Data Link Layer (DLL) – Layer 6
❑ The data link layer is responsible for the node-to-node delivery of the message.
❑ The main function of this layer is to make sure data transfer is error-free from
one node to another, over the physical layer.
❑ When a packet arrives in a network, it is the responsibility of the DLL to
transmit it to the Host using its MAC address.
❑ The Data Link Layer is divided into two sublayers:
1. Logical Link Control (LLC)
2. Media Access Control (MAC)
18
Network Reference Models(ISO Model)
➢ The packet received from the Network layer is further divided into frames
depending on the frame size of the NIC(Network Interface Card).
➢ DLL also encapsulates Sender and Receiver’s MAC address in the header.
➢ The Receiver’s MAC address is obtained by placing an ARP(Address Resolution
Protocol) request onto the wire asking “Who has that IP address?” and the destination
host will reply with its MAC address.
19
Network Reference Models(ISO Model)
❑ Flow Control: The data rate must be constant on both sides else the data may get
corrupted thus, flow control coordinates the amount of data that can be sent before
receiving an acknowledgment.
❑ Access control: When a single communication channel is shared by multiple
devices, the MAC sub-layer of the data link layer helps to determine which device
has control over the channel at a given time.
21
Network Reference Models(ISO Model)
Note:
1. Packet in the Data Link layer is referred to as Frame.
2. Data Link layer is handled by the NIC (Network Interface
Card) and device drivers of host machines.
3. Switch & Bridge are Data Link Layer devices.
22
Network Reference Models(ISO Model)
Physical Layer – Layer 7
❑ The lowest layer of the OSI reference model is the physical layer.
❑ The Physical layer is responsible for transmitting raw bits over a communication
channel.
❑ It is responsible for the actual physical connection between the devices.
❑ The physical layer contains information in the form of bits.
❑ It is responsible for transmitting individual bits from one node to the next.
❑ When receiving data, this layer will get the signal received and convert it into 0s and 1s
and send them to the Data Link layer, which will put the frame back together.
23
Network Reference Models(ISO Model)
Functions of the Physical Layer
❑ Bit synchronization: The physical layer provides the synchronization of the bits by
providing a clock. This clock controls both sender and receiver thus providing
synchronization at the bit level.
❑ Bit rate control: The Physical layer also defines the transmission rate i.e. the
number of bits sent per second.
❑ Physical topologies: Physical layer specifies how the different, devices/nodes are
arranged in a network i.e. bus, star, or mesh topology.
❑ Transmission mode: Physical layer also defines how the data flows between the two
connected devices. 24
❖ The various transmission modes possible are Simplex, half-duplex and full-duplex.
Network Reference Models(ISO Model)
25
Outline
➢ Network Reference Models.
❑ ISO Model
❑ TCP/IP Model
➢ Services:
❑ Electronic Mail.
❑ The World Wide Web.
❑ Multimedia–Based Services.
26
Network Reference Models(TCP/IP Model )
28
Network Reference Models(TCP/IP Model)
Host-to-Host layer
❑ It is equivalent to the transport layer of the OSI model and is responsible for
delivery of data.
❑ It depends on which type of protocol is used whether it’s Transmission Control
Protocol (TCP) or User Datagram Protocol (UDP).
❑ If reliable delivery of data is needed, then TCP will be used. UDP is used, if fast
delivery without reliability is needed.
❑ In this layer, TCP and UDP the protocols which are used and data acts as a
Protocol Data Unit (PDU).
29
Network Reference Models(TCP/IP Model)
Internet layer
❑ It is equivalent to the Network layer of the OSI model. Logical addressing and
routing is performed at this layer by using the IP address of a device.
❑ At this layer the routers forward the packet on the basis of IP addresses of
devices. IP is the most important protocol at this layer
❑ The protocols used at this layer are Internet Control Message Protocol (ICMP)
and Internet Group Management Protocol (IGMP).
❑ PDU at this layer is Packet.
30
Network Reference Models(TCP/IP Model)
Network Access layer
❑ It is equivalent to the Data link layer and Physical layer of the OSI model.
Hardware addressing is done at this layer.
❑ It defines protocols for physical transmission of data. Ethernet is the most
important protocol used at this layer.
❑ Fast Ethernet, Token Ring and Fiber Distributed Data Interface (FDDI) are other
protocols at this layer.
❑ PDU at this layer is called frame.
31
Outline
➢ Network Reference Models.
❑ ISO Model
❑ TCP/IP Model
➢ Services:
❑ Electronic Mail.
❑ The World Wide Web.
❑ Multimedia–Based Services.
32
Electronic Mail
➢ Nowadays, the e-mail service is one of the most used means of electronic
communications.
➢ It involves users sending messages to other users via the network.
➢ The e-mail system is composed of a User Agent (UA) and a Message Transfer
Agent (MTA).
➢ The UA allows users to send and retrieve messages and may also provide a graphical
user interface.
➢ The MTA transfers the messages from the source to the destination.
33
Electronic Mail
➢ The e-mail system requires several services to be provided by the two agent
components: UA and MTA.
➢ Composition is provided by UA and refers to the creation of messages and reply
messages.
➢ Transfer is ensured by MTA and refers to delivering the messages from source to
destination.
➢ Reporting, also provided by MTA, involves informing the sender about the status
of the messages sent.
34
Electronic Mail
➢ Displaying is provided by UA through the user interface and involves displaying the
message so that it can be accessed by the user.
➢ Depending on the type of content, sometimes the messages need to be converted
before displaying. Often another program is invoked, such as plug-in (embedded in
the mail client application) or application (independent from the mail client
application).
➢ Disposition, managed by the UA, refers to what the remote user does with the
message (e.g., save, delete, etc.).
35
Electronic Mail(Cont.)
➢ As shown in figure the basic principle of the e-mail service.
36
37
E-Mail Message
Electronic Mail(Cont.)
➢ Simple Mail Transfer Protocol (SMTP): allows messages to be sent from UA to
MTA.
➢ SMTP works on top of TCP and in general uses port 25.
➢ The client initiates the TCP connection with the server and waits for the server to
state it is ready.
➢ After the server confirms it is ready, the communication sequence commences.
➢ The client sends commands and the server responds with command status messages.
➢ Status messages include ASCII encoded numeric codes and details in text.
➢ The order of the commands is very important for the success of the message 38
sending operation
Electronic Mail(Cont.)
42
Outline
➢ Network Reference Models.
❑ ISO Model
❑ TCP/IP Model
➢ Services:
❑ Electronic Mail.
❑ The World Wide Web.
❑ Multimedia–Based Services.
43
The World Wide Web
➢ The World Wide Web , also known as the web, WWW or W3 : refers to all the public
websites or pages that users can access on their local computers and other devices
through the internet.
➢ In another word, the World Wide Web represents a framework allowing client
machines to access linked documents spread over millions of servers all over the
Internet.
➢ These pages and documents are interconnected by means of hyperlinks that users
click on for information.
➢ This information can be in different formats, including text, images, audio and
video. 44
The World Wide Web(Cont.)
➢ This Figure shows the principle of accessing web documents over the Internet.
45
➢ The web pages are displayed on the client machine by an application called a
browser. Internet Explorer, Firefox, and Chrome are among the most popular.
➢ Web content transfer accounts for most data transfers over the Internet.
❑ It involves communications between Web clients (browsers) and Web servers.
❑ where clients request a piece of Web content from servers and the servers respond
delivering it.
46
The World Wide Web(Cont.)
➢ The web pages are stored or generated by a web server and are delivered to the
client on request.
➢ The protocol used by the web client (browser) to interact with a web-server is
Hypertext Transfer Protocol (HTTP) and it works on top of TCP and uses port 80.
➢ In general, client sends requests& server respondsi.e.at least each session involves one
request response.
47
The World Wide Web(Cont.)
➢ Web pages or documents can be classified into three categories: Static, Active, and
Dynamic.
➢ Static documents are identically delivered at every request and to any user.
❑ These documents are modified by replacing the original file on the server.
❑ These documents are created using languages such as HTML, XML, XHTML, CSS, XSL,
and are easy to create.
❑ Fast to retrieve, these documents do not require much processing on the server or client.
Being static, these types of documents can be cached on the client’s machine or in nearby
servers for faster delivery.
❑ Despite the performance advantages, static documents are difficult to maintain consistent
48
and up to date.
The World Wide Web(Cont.)
50
The World Wide Web(Cont.)
➢ Dynamic documents are generated on the fly by the server, at client request.
❑ This type of document enables user personalization, supports database access,
data display customization and can use time and date sensitive code.
➢ Among the disadvantages of using dynamic documents are:
❑ their complexity, high resource requirements on the server side and the fact that
they are not cache friendly.
➢ Among the most popular technologies for dynamic documents processing
are Hypertext Processor (PHP), Java Servlets, and Java Server Pages (JSP).
51
Outline
➢ Network Reference Models.
❑ ISO Model
❑ TCP/IP Model
➢ Services:
❑ Electronic Mail.
❑ The World Wide Web.
❑ Multimedia–Based Services.
52
Multimedia- Based Services
➢ Multimedia represents content of different forms including text, images, audio,
video, and animations.
➢ Multimedia content is increasingly popular nowadays and accounts for a high share of
the data traffic transported over the Internet.
53
Multimedia- Based Services(Cont.)
54
Multimedia- Based Services(Cont.)
For Audio
❑ Audio requires relatively low bandwidth and has real-time constraints.
For Image
❑ Still images require higher bandwidths (depending on the size and encoding of the
image) and no real-time constraints.
For Animation
❑ Animation consists of a set of still images displayed successively and require higher
bandwidth (depending on the size and encoding of the image) and no real-time
constraints.
55
Multimedia- Based Services(Cont.)
For Video
❑ Video content consists of a sequence of still images named frames displayed in a
predefined order and at precise timing to create the illusion of motion.
❑ It requires high bandwidth and has real-time constraints.
❑ The raw frames of a video clip would require a huge amount of data storage,
even for today standards, and would be impractical to transfer over the network.
❑ In order to reduce the amount of data and make video storage and streaming
effective, compression techniques have to be used.
❑ Consequently, during video encoding, compression algorithms are employed to
reduce the amount of data required to store and transport the video data. 56
Multimedia- Based Services(Cont.)
58