Topic 3- Internet Networking Flashcards
Stream Transport
• Stream: sequence of bytes flows from one
application program to another
• Without attaching meaning to the bytes and without
inserting boundaries
• Two streams between pair of communicating
applications, one in each direction
• Accepts input from one, delivers to the other • Sending application can choose to generate one byte
at a time or can generate blocks of bytes
• Network can choose to combine smaller blocks into one
large block or divide a large block into smaller blocks
It is connection oriented, 1-1 communication of sequence of individual bites. It is used in most applications and built on TCP protocol.
Stream service is connection-oriented:
Applications must request connection be created Once established, connection allows applications to
send data in either direction Finally, when communication finishes, the
applications request the connection be terminated
Message transport
Message: the network accepts and delivers messages
• Each message delivered corresponds to message
transmitted • Never delivers part of a message, nor does it join
multiple messages together • Sender places exactly n bytes in outgoing message • Receiver receives n bytes in the incoming message
Connectionless, many to many communication of sequence of individual messages, each limited to 64 kbytes and used for multimedia applications such as zoom. It is built on UDP protocol.
3 main message transport types
Message Transport Types
1. Unicast
• a message can be sent from an application on
one computer directly to an application on another, 1-to-1
2. Multicast
• a message can be multicast to some of the
computers on a network, 1-to-many
3. Broadcast
• a message can be broadcast to all computers on
a given network, 1-to-all
Message vs stream reliability
Message UDP transport is unreliable • Unreliable means no guarantee:
1. Lost: never delivered
2. Duplication: more than one copy arrives
3. Ordered: out-of-order • Programmers must ensure the application operates
correctly even if packets are lost or reordered
Most applications require delivery guarantees
• Use stream services • Programmers tend to use stream service except in
special situations
• E.g. video, where multicast is needed, the
application provides support to handle packet reordering and loss
Client Server model
client-server model
handle all services in the Internet
• A server starts first and awaits contact • A client starts second and initiates the connection
• Application programs known as clients and servers
Characteristics of Client Software
- Invoked directly by a user, executes only for one
session - Runs locally on a user’s personal computer
- Actively initiates contact with a server
- Can access multiple services as needed, but
usually contacts one remote server at a time - Does not require especially powerful computer
hardware
Characteristics of Server Software
- A special-purpose, privileged program
- Dedicated to providing one service that can handle
multiple remote clients at the same time - Is invoked automatically when a system boots, and
continues to execute through many sessions - Runs on a large, powerful computer
- Waits passively for contact from arbitrary remote clients
- Accepts contact from arbitrary clients, but offers a single
service - Requires powerful hardware and a sophisticated OS
1 computer - multiple clients
Multiple Clients Benefits
• A computer with multiple clients is useful as services
can be accessed simultaneously • For example, a user can have three (3) windows open
simultaneously running three (3) applications:
1. Email 2. Chat service 3. Web browser
1 Computer - Multiple Servers
• A computer that operate multiple servers is useful
• Hardware can be shared
• Has lower system administration overhead than
multiple computer systems • Demand for a server is often sporadic:
• Server can remain idle for long periods of time
and does not use the CPU while waiting for a
request to arrive
• If demand is low, consolidating servers can reduce
cost without reducing performance
DNS
Domain name system
Translates human readable domain names (www.Amazon.com) to machine readable IP addresses (192.0.2.44)
IP
Each computer in the Internet is assigned a unique
32-bit identifier known as an Internet Protocol (IP)
address
• 192.168.1.0
• It is an Internet layer address
Port number
Each service available in the Internet is assigned a unique 16-bit identifier known as port number
• Email: 25, HTTP: 80 • It is a Transport layer address
For example
A server for all google services (google, gmail, drive, photos) ip is not enough, it will reach the server but also a port number is required to specify the application chosen
Server Circular Dependencies
• Circular dependencies: a server for one service can
act as client for another
• Before it can fill in a web page, a web server may need to
become a client of a database • A server may also become the client of a security service
to verify a client is allowed access to the service
For example
When you as client enter username and password for mail service the mail is also a client for authentication server to check the details on the database
Concurrent Servers
• Most servers are concurrent (simultaneous)
• A server uses more than one thread of control • Concurrent execution depends on the OS being used
and the code is divided into 2 pieces
1. Main program (thread)
2. Handler
• Main thread accepts contact from client and creates a
thread of control for the client (always listening)
• Each thread of control interacts with a single client and
runs the handler code
After handling one client the thread terminates
• Main thread keeps server alive after creating a
thread to handle a request
• If N clients are simultaneously using a concurrent
server, N+1 threads will be running:
• N threads for each client
• +1 main thread to wait for additional requests
Server bottlenecks
Server Bottlenecks
• If a single server provides a given service
• the network connection between the server and
the Internet can become a bottleneck
How to avoid?
One way to avoid a bottleneck forms the basis of file sharing known as a peer-to-peer (P2P) architecture
• Data is distributed equally among a set of N servers • Each request is sent to the appropriate server
• Each server only provides 1/N of the data