SlideShare a Scribd company logo
Processes (Part III)
Amir H. Payberah
amir@sics.se
Amirkabir University of Technology
(Tehran Polytechnic)
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 1 / 50
Inter-Process Communication
(IPC)
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 2 / 50
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 3 / 50
Socket
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 4 / 50
Let’s First Review The Basic
Concepts of TCP/IP
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 5 / 50
Internetworking
An internetwork (internet (with a lowercase i)) is a network of com-
puter networks.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 6 / 50
Internetworking
An internetwork (internet (with a lowercase i)) is a network of com-
puter networks.
Subnetwork refers to one of the networks composing an internet.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 6 / 50
Internetworking
An internetwork (internet (with a lowercase i)) is a network of com-
puter networks.
Subnetwork refers to one of the networks composing an internet.
An internet aims to hide the details of different physical networks,
to present a unified network architecture.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 6 / 50
The Internet
TCP/IP has become the dominant protocol for the internetworking.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 7 / 50
The Internet
TCP/IP has become the dominant protocol for the internetworking.
The Internet (with an uppercase I) refers to the TCP/IP internet
that connects millions of computers globally.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 7 / 50
The Internet
TCP/IP has become the dominant protocol for the internetworking.
The Internet (with an uppercase I) refers to the TCP/IP internet
that connects millions of computers globally.
The first widespread implementation of TCP/IP appeared with
4.2BSD in 1983.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 7 / 50
Networking Protocols and Layers
A networking protocol is a set of rules defining how information is
to be transmitted across a network.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
Networking Protocols and Layers
A networking protocol is a set of rules defining how information is
to be transmitted across a network.
Networking protocols are generally organized as a series of layers.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
Networking Protocols and Layers
A networking protocol is a set of rules defining how information is
to be transmitted across a network.
Networking protocols are generally organized as a series of layers.
Each layer building on the layer below it to add features that are
made available to higher layers.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
Networking Protocols and Layers
A networking protocol is a set of rules defining how information is
to be transmitted across a network.
Networking protocols are generally organized as a series of layers.
Each layer building on the layer below it to add features that are
made available to higher layers.
Transparency: each protocol layer shields higher layers from the
operation and complexity of lower layers.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
TCP/IP Protocol Suite
The TCP/IP protocol suite is a layered networking protocol.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 9 / 50
TCP/IP Protocol Layers
Data-Link layer
Network layer (IP)
Transport layer (TCP, UDP)
Application
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 10 / 50
Encapsulation
Encapsulation: the information passed from a higher layer to a lower
layer is treated as opaque data by the lower layer.
• The lower layer does not interpret information from the upper layer.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 11 / 50
Encapsulation
Encapsulation: the information passed from a higher layer to a lower
layer is treated as opaque data by the lower layer.
• The lower layer does not interpret information from the upper layer.
When data is passed up from a lower layer to a higher layer, a
converse unpacking process takes place.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 11 / 50
Data-Link Layer (1/3)
It is concerned with transferring data across a physical link in a
network.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 12 / 50
Data-Link Layer (1/3)
It is concerned with transferring data across a physical link in a
network.
It consists of the device driver and the hardware interface (network
card) to the underlying physical medium, e.g., fiber-optic cable.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 12 / 50
Data-Link Layer (2/3)
The data-link layer encapsulates datagrams from the network layer
into units, called frames.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 13 / 50
Data-Link Layer (2/3)
The data-link layer encapsulates datagrams from the network layer
into units, called frames.
It also adds each frame a header containing the destination address
and frame size.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 13 / 50
Data-Link Layer (2/3)
The data-link layer encapsulates datagrams from the network layer
into units, called frames.
It also adds each frame a header containing the destination address
and frame size.
The data-link layer transmits the frames across the physical link and
handles acknowledgements from the receiver.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 13 / 50
Data-Link Layer (3/3)
From an application-programming point of view, we can generally
ignore the data-link layer, since all communication details are han-
dled in the driver and hardware.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 14 / 50
Data-Link Layer (3/3)
From an application-programming point of view, we can generally
ignore the data-link layer, since all communication details are han-
dled in the driver and hardware.
Maximum Transmission Unit (MTU): the upper limit that the layer
places on the size of a frame.
• data-link layers have different MTUs.
netstat -i
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 14 / 50
Network Layer (1/4)
It is concerned with delivering data from the source host to the
destination host.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 15 / 50
Network Layer (1/4)
It is concerned with delivering data from the source host to the
destination host.
It tasks include:
• Breaking data into fragments small enough for transmission via the
data-link layer.
• Routing data across the internet.
• Providing services to the transport layer.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 15 / 50
Network Layer (1/4)
It is concerned with delivering data from the source host to the
destination host.
It tasks include:
• Breaking data into fragments small enough for transmission via the
data-link layer.
• Routing data across the internet.
• Providing services to the transport layer.
In the TCP/IP protocol suite, the principal protocol in the network
layer is IP.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 15 / 50
Network Layer (2/4)
IP transmits data in the form of packets.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 16 / 50
Network Layer (2/4)
IP transmits data in the form of packets.
Each packet sent between two hosts travels independently across
the network.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 16 / 50
Network Layer (2/4)
IP transmits data in the form of packets.
Each packet sent between two hosts travels independently across
the network.
An IP packet includes a header that contains the address of the
source and target hosts.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 16 / 50
Network Layer (3/4)
IP is a connectionless protocol: it does not provide a virtual circuit
connecting two hosts.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 17 / 50
Network Layer (3/4)
IP is a connectionless protocol: it does not provide a virtual circuit
connecting two hosts.
IP is an unreliable protocol: it makes a best effort to transmit data-
grams from the sender to the receiver, but it does not guarantee:
• that packets will arrive in the order they were transmitted,
• that they will not be duplicated,
• that they will arrive at all.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 17 / 50
Network Layer (4/4)
An IP address consists of two parts:
• Network ID: specifies the network on which a host resides.
• Host ID: identifies the host within that network.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 18 / 50
Network Layer (4/4)
An IP address consists of two parts:
• Network ID: specifies the network on which a host resides.
• Host ID: identifies the host within that network.
An IPv4 address consists of 32 bits: 204.152.189.0/24
• loopback 127.0.0.1 refers to system on which process is running.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 18 / 50
Network Layer (4/4)
An IP address consists of two parts:
• Network ID: specifies the network on which a host resides.
• Host ID: identifies the host within that network.
An IPv4 address consists of 32 bits: 204.152.189.0/24
• loopback 127.0.0.1 refers to system on which process is running.
Network mask: a sequence of 1s in the leftmost bits, followed by a
sequence of 0s
• The 1s indicate which part of the address contains the assigned
network ID.
• The 0s indicate which part of the address is available to assign as
host IDs.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 18 / 50
Transport Layer (1/5)
Transport protocol provides an end-to-end communication service
to applications residing on different hosts.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 19 / 50
Transport Layer (1/5)
Transport protocol provides an end-to-end communication service
to applications residing on different hosts.
Two widely used transport-layer protocols in the TCP/IP suite:
• User Datagram Protocol (UDP): the protocol used for datagram
sockets.
• Transmission Control Protocol (TCP): the protocol used for stream
sockets.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 19 / 50
Transport Layer (2/5)
Port: a method of differentiating the applications on a host.
• 16-bit number
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 20 / 50
Transport Layer (2/5)
Port: a method of differentiating the applications on a host.
• 16-bit number
• All ports below 1024 are well known, used for standard services,
e.g., http: 80, ssh: 22.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 20 / 50
Transport Layer (2/5)
Port: a method of differentiating the applications on a host.
• 16-bit number
• All ports below 1024 are well known, used for standard services,
e.g., http: 80, ssh: 22.
• Shown as 192.168.1.1:8080.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 20 / 50
Transport Layer (3/5)
UDP, like IP, is connectionless and unreliable.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 21 / 50
Transport Layer (3/5)
UDP, like IP, is connectionless and unreliable.
If an application layered on top of UDP requires reliability, then this
must be implemented within the application.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 21 / 50
Transport Layer (3/5)
UDP, like IP, is connectionless and unreliable.
If an application layered on top of UDP requires reliability, then this
must be implemented within the application.
UDP adds just two features to IP:
• Port number
• Data checksum to allow the detection of errors in the transmitted
data.
[http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm]
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 21 / 50
Transport Layer (4/5)
TCP provides a reliable, connection-oriented, bidirectional, byte-
stream communication channel between two endpoints.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 22 / 50
Transport Layer (4/5)
TCP provides a reliable, connection-oriented, bidirectional, byte-
stream communication channel between two endpoints.
Before communication can commence, TCP establishes a commu-
nication channel between the two endpoints.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 22 / 50
Transport Layer (5/5)
In TCP, data is broken into segments: each is transmitted in a single
IP packet.
[http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm]
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 23 / 50
Transport Layer (5/5)
In TCP, data is broken into segments: each is transmitted in a single
IP packet.
When a destination receives a TCP segment, it sends an ack. to
the sender, informing weather it received the segment correctly or
not.
[http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm]
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 23 / 50
Transport Layer (5/5)
In TCP, data is broken into segments: each is transmitted in a single
IP packet.
When a destination receives a TCP segment, it sends an ack. to
the sender, informing weather it received the segment correctly or
not.
Other features of TCP:
• Sequencing
• Flow control
• Congestion control
[http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm]
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 23 / 50
OK, Let’s Back to Socket
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 24 / 50
Socket
A socket is defined as an endpoint for communication.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 25 / 50
Socket
A socket is defined as an endpoint for communication.
A typical client-server scenario:
• Each process creates a socket: both processes require one.
• The server binds its socket to a well-known address (name) so that
clients can locate it.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 25 / 50
Creating a Socket
socket() creates a new socket.
#include <sys/socket.h>
int socket(int domain, int type, int protocol);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 26 / 50
Socket Domains
The UNIX domain (AF UNIX)
• Communication between processes on the same host (within the
kernel).
• Address format: path name.
int socket(int domain, int type, int protocol);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 27 / 50
Socket Domains
The UNIX domain (AF UNIX)
• Communication between processes on the same host (within the
kernel).
• Address format: path name.
The IPV4 domain (AF INET)
• Communication between processes running on hosts connected via
an IPv4 network.
• Address format: 32-bit IPv4 address + 16-bit port number.
int socket(int domain, int type, int protocol);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 27 / 50
Socket Types
Stream sockets (SOCK STREAM)
• It provides a reliable, bidirectional, byte-stream communication
channel.
• Called connection-oriented.
int socket(int domain, int type, int protocol);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 28 / 50
Socket Types
Stream sockets (SOCK STREAM)
• It provides a reliable, bidirectional, byte-stream communication
channel.
• Called connection-oriented.
Datagram sockets (SOCK DGRAM)
• Allow data to be exchanged in the form of messages called
datagrams.
• Called connectionless.
int socket(int domain, int type, int protocol);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 28 / 50
Binding a Socket to an Address
bind() binds a socket to an address.
#include <sys/socket.h>
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 29 / 50
Listening for Incoming Connections
listen() marks the stream socket passive.
The socket will subsequently be used to accept connections from
other (active) sockets.
#include <sys/socket.h>
int listen(int sockfd, int backlog);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 30 / 50
Accepting a Connection
accept() accepts an incoming connection on the listening stream
socket.
If there are no pending connections when accept() is called, the
call blocks until a connection request arrives.
#include <sys/socket.h>
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 31 / 50
Connecting to a Peer Socket
connect() connects the active socket to the listening socket whose
address is specified by addr and addrlen.
#include <sys/socket.h>
int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 32 / 50
Stream Sockets
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 33 / 50
Producer-Consumer vi Stream Socket (1/2)
Producer (Server)
int sockfd, connfd;
struct sockaddr_in serv_addr, cli_addr;
socklen_t cli_len;
char buffer[256];
bzero(&serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(32000);
sockfd = socket(AF_INET, SOCK_STREAM, 0);
bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
listen(sockfd, 5);
cli_len = sizeof(cli_addr);
connfd = accept(sockfd, (struct sockaddr *)&cli_addr, &cli_len);
read(connfd, buffer, 255);
write(connfd, "I got your message", 18);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 34 / 50
Producer-Consumer vi Stream Socket (2/2)
Consumer (Client)
int sockfd, connfd;
struct sockaddr_in serv_addr, cli_addr;
socklen_t clilen;
char *buf = "hello";
char rec_buf[256];
bzero(&serv_addr,sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = inet_addr("x.x.x.x");
serv_addr.sin_port = htons(32000);
sockfd = socket(AF_INET, SOCK_STREAM, 0);
connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
write(sockfd, buf, strlen(buf));
read(sockfd, recv_buf, 255);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 35 / 50
Internet Socket Addresses
An IPv4 socket address is stored in a sockaddr in structure, defined
in <netinet/in.h>.
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
struct sockaddr {
sa_family_t sa_family; // Address family (AF_* constant)
char sa_data[14]; // Socket address
};
struct sockaddr_in { // IPv4 socket address
sa_family_t sin_family; // Address family (AF_INET)
in_port_t sin_port; // Port number
struct in_addr sin_addr; // IPv4 address
unsigned char _pad[X]; // Pad to size of ’sockaddr’ structure (16 bytes)
};
struct in_addr { // IPv4 4-byte address
in_addr_t s_addr; // Unsigned 32-bit integer
};
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 36 / 50
Datagram Sockets
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 37 / 50
Exchanging Datagrams
recvfrom() and sendto() receive and send datagrams on a data-
gram socket.
#include <sys/socket.h>
ssize_t sendto(int sockfd, const void *buffer, size_t length, int flags,
const struct sockaddr *dest_addr, socklen_t addrlen);
ssize_t recvfrom(int sockfd, void *buffer, size_t length, int flags,
struct sockaddr *src_addr, socklen_t *addrlen);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 38 / 50
Producer-Consumer vi Datagram Socket (1/2)
Producer (Server)
int sockfd, n;
struct sockaddr_in serv_addr, cli_addr;
socklen_t cli_len;
char buf[256];
bzero(&serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(32000);
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
cli_len = sizeof(cli_addr);
n = recvfrom(sockfd, buf, 255, 0, (struct sockaddr *)&cli_addr, &cli_len);
sendto(sockfd, buf, n, 0, (struct sockaddr *)&cli_addr,sizeof(cli_addr));
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 39 / 50
Producer-Consumer vi Datagram Socket (2/2)
Consumer (Client)
int sockfd, connfd;
struct sockaddr_in serv_addr, cli_addr;
socklen_t clilen;
char *buf = "hello";
char recv_buf[256];
bzero(&serv_addr,sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = inet_addr("x.x.x.x");
serv_addr.sin_port = htons(32000);
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
sendto(sockfd, buf, strlen(buf), 0, (struct sockaddr *)&serv_addr,
sizeof(serv_addr));
recvfrom(sockfd, recv_buf, 255, 0, NULL, NULL);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 40 / 50
Signals
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 41 / 50
Signals (1/2)
Signals are software interrupts to notify a process that a particular
event has occurred.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 42 / 50
Signals (1/2)
Signals are software interrupts to notify a process that a particular
event has occurred.
These events can originate from outside the system, e.g., by pressing
Ctrl-C, or when a process executes code that divides by zero.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 42 / 50
Signals (1/2)
Signals are software interrupts to notify a process that a particular
event has occurred.
These events can originate from outside the system, e.g., by pressing
Ctrl-C, or when a process executes code that divides by zero.
As a primitive form of IPC, one process can also send a signal to
another process.
ps -aux | grep acrobat
amir 7302 0.0 0.0 ...
kill -9 7302
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 42 / 50
Signals (2/2)
A signal handler is used to process signals.
1 Signal is generated by particular event.
2 Signal is delivered to a process.
3 Signal is handled by one of two signal handlers: default or
user-defined.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 43 / 50
Signals (2/2)
A signal handler is used to process signals.
1 Signal is generated by particular event.
2 Signal is delivered to a process.
3 Signal is handled by one of two signal handlers: default or
user-defined.
Every signal has default handler that kernel runs when handling
signal
User-defined signal handler can override default.
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 43 / 50
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 44 / 50
Signal Management
signal() removes the current action taken on receipt of the sig-
nal signo and instead handles the signal with the signal handler
specified by handler.
#include <signal.h>
typedef void (*sighandler_t)(int);
sighandler_t signal(int signo, sighandler_t handler);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 45 / 50
Waiting for a Signal
pause() puts a process to sleep until it receives a signal.
#include <unistd.h>
int pause(void);
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 46 / 50
Signal Example
// handler for SIGINT
static void sigint_handler(int signo) {
printf("Caught SIGINT!n");
exit(0);
}
int main(void) {
// Register sigint_handler as our signal handler for SIGINT.
if (signal(SIGINT, sigint_handler) == SIG_ERR)
exit(1);
pause();
return 0;
}
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 47 / 50
Summary
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 48 / 50
Summary
TCP-IP protocol layers: data-link, network, transport, application
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
Summary
TCP-IP protocol layers: data-link, network, transport, application
Data-link: network card
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
Summary
TCP-IP protocol layers: data-link, network, transport, application
Data-link: network card
Network layer: routing, IP, 32-bit address, 16-bit port
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
Summary
TCP-IP protocol layers: data-link, network, transport, application
Data-link: network card
Network layer: routing, IP, 32-bit address, 16-bit port
Transport layer: TCP (stream, connection-oriented), UDP (data-
gram, connectionless)
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
Summary
TCP-IP protocol layers: data-link, network, transport, application
Data-link: network card
Network layer: routing, IP, 32-bit address, 16-bit port
Transport layer: TCP (stream, connection-oriented), UDP (data-
gram, connectionless)
Sockets
Signal: software interrupts
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
Questions?
Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 50 / 50

More Related Content

What's hot

Process Synchronization - Part1
Process Synchronization -  Part1Process Synchronization -  Part1
Process Synchronization - Part1
Amir Payberah
 
CPU Scheduling - Part2
CPU Scheduling - Part2CPU Scheduling - Part2
CPU Scheduling - Part2
Amir Payberah
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
Amir Payberah
 
Main Memory - Part2
Main Memory - Part2Main Memory - Part2
Main Memory - Part2
Amir Payberah
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
Amir Payberah
 
Virtual Memory - Part2
Virtual Memory - Part2Virtual Memory - Part2
Virtual Memory - Part2
Amir Payberah
 
main memory
main memorymain memory
main memory
Mavoori Soshmitha
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of Processors
Gaditek
 
IO Management
IO ManagementIO Management
IO Management
J.T.A.JONES
 
Pipelining in computer architecture
Pipelining in computer architecturePipelining in computer architecture
Pipelining in computer architecture
Ramakrishna Reddy Bijjam
 
Pipelining In computer
Pipelining In computer Pipelining In computer
Pipelining In computer
Talesun Solar USA Ltd.
 
Pipelinig hazardous
Pipelinig hazardousPipelinig hazardous
Pipelinig hazardous
jasscheema
 
Operating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputOperating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / Output
Peter Tröger
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
Sanjeev Patel
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
Wayne Jones Jnr
 
Chapter6 pipelining
Chapter6  pipeliningChapter6  pipelining
Chapter6 pipelining
Gurpreet Singh
 
A044050107
A044050107A044050107
A044050107
IJERA Editor
 
Chapter1-Introduction.pdf
Chapter1-Introduction.pdfChapter1-Introduction.pdf
Chapter1-Introduction.pdf
GhulamHussain142878
 
Io system
Io systemIo system
Io system
malarselvi mms
 
Presentation on risc pipeline
Presentation on risc pipelinePresentation on risc pipeline
Presentation on risc pipeline
Arijit Chakraborty
 

What's hot (20)

Process Synchronization - Part1
Process Synchronization -  Part1Process Synchronization -  Part1
Process Synchronization - Part1
 
CPU Scheduling - Part2
CPU Scheduling - Part2CPU Scheduling - Part2
CPU Scheduling - Part2
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Main Memory - Part2
Main Memory - Part2Main Memory - Part2
Main Memory - Part2
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Virtual Memory - Part2
Virtual Memory - Part2Virtual Memory - Part2
Virtual Memory - Part2
 
main memory
main memorymain memory
main memory
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of Processors
 
IO Management
IO ManagementIO Management
IO Management
 
Pipelining in computer architecture
Pipelining in computer architecturePipelining in computer architecture
Pipelining in computer architecture
 
Pipelining In computer
Pipelining In computer Pipelining In computer
Pipelining In computer
 
Pipelinig hazardous
Pipelinig hazardousPipelinig hazardous
Pipelinig hazardous
 
Operating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputOperating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / Output
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
Chapter6 pipelining
Chapter6  pipeliningChapter6  pipelining
Chapter6 pipelining
 
A044050107
A044050107A044050107
A044050107
 
Chapter1-Introduction.pdf
Chapter1-Introduction.pdfChapter1-Introduction.pdf
Chapter1-Introduction.pdf
 
Io system
Io systemIo system
Io system
 
Presentation on risc pipeline
Presentation on risc pipelinePresentation on risc pipeline
Presentation on risc pipeline
 

Viewers also liked

P2P Content Distribution Network
P2P Content Distribution NetworkP2P Content Distribution Network
P2P Content Distribution Network
Amir Payberah
 
Threads
ThreadsThreads
Threads
Amir Payberah
 
Security
SecuritySecurity
Security
Amir Payberah
 
Storage
StorageStorage
Storage
Amir Payberah
 
The Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformThe Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics Platform
Amir Payberah
 
Data Intensive Computing Frameworks
Data Intensive Computing FrameworksData Intensive Computing Frameworks
Data Intensive Computing Frameworks
Amir Payberah
 
File System Interface
File System InterfaceFile System Interface
File System Interface
Amir Payberah
 
CPU Scheduling - Part1
CPU Scheduling - Part1CPU Scheduling - Part1
CPU Scheduling - Part1
Amir Payberah
 
Virtual Memory - Part1
Virtual Memory - Part1Virtual Memory - Part1
Virtual Memory - Part1
Amir Payberah
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
Amir Payberah
 
Main Memory - Part1
Main Memory - Part1Main Memory - Part1
Main Memory - Part1
Amir Payberah
 
Distributed Hash Table
Distributed Hash TableDistributed Hash Table
Distributed Hash Table
Amir Payberah
 
Google File System
Google File SystemGoogle File System
Google File System
Amir Payberah
 
File System Implementation - Part2
File System Implementation - Part2File System Implementation - Part2
File System Implementation - Part2
Amir Payberah
 
Graph processing - Pregel
Graph processing - PregelGraph processing - Pregel
Graph processing - Pregel
Amir Payberah
 
Spark Stream and SEEP
Spark Stream and SEEPSpark Stream and SEEP
Spark Stream and SEEP
Amir Payberah
 

Viewers also liked (16)

P2P Content Distribution Network
P2P Content Distribution NetworkP2P Content Distribution Network
P2P Content Distribution Network
 
Threads
ThreadsThreads
Threads
 
Security
SecuritySecurity
Security
 
Storage
StorageStorage
Storage
 
The Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformThe Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics Platform
 
Data Intensive Computing Frameworks
Data Intensive Computing FrameworksData Intensive Computing Frameworks
Data Intensive Computing Frameworks
 
File System Interface
File System InterfaceFile System Interface
File System Interface
 
CPU Scheduling - Part1
CPU Scheduling - Part1CPU Scheduling - Part1
CPU Scheduling - Part1
 
Virtual Memory - Part1
Virtual Memory - Part1Virtual Memory - Part1
Virtual Memory - Part1
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
 
Main Memory - Part1
Main Memory - Part1Main Memory - Part1
Main Memory - Part1
 
Distributed Hash Table
Distributed Hash TableDistributed Hash Table
Distributed Hash Table
 
Google File System
Google File SystemGoogle File System
Google File System
 
File System Implementation - Part2
File System Implementation - Part2File System Implementation - Part2
File System Implementation - Part2
 
Graph processing - Pregel
Graph processing - PregelGraph processing - Pregel
Graph processing - Pregel
 
Spark Stream and SEEP
Spark Stream and SEEPSpark Stream and SEEP
Spark Stream and SEEP
 

Similar to Process Management - Part3

U5CSS3 (1).pdf
U5CSS3 (1).pdfU5CSS3 (1).pdf
U5CSS3 (1).pdf
chelsi33
 
TCP/IP Introduction
TCP/IP IntroductionTCP/IP Introduction
TCP/IP Introduction
Naveen Kumar R.B.
 
presentation on TCP/IP protocols data comunications
presentation on TCP/IP protocols data comunicationspresentation on TCP/IP protocols data comunications
presentation on TCP/IP protocols data comunications
AnyapuPranav
 
TCP/IP Modal
TCP/IP ModalTCP/IP Modal
TCP/IP Modal
ParikshitTaksande1
 
OSI Layers
OSI LayersOSI Layers
02 protocol architecture
02 protocol architecture02 protocol architecture
02 protocol architecture
chameli devi group of institutions
 
Wireshark - Basics
Wireshark - BasicsWireshark - Basics
Wireshark - Basics
Yoram Orzach
 
CN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdfCN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdf
skknowledge
 
02-ProtocolArchitecture.pdf
02-ProtocolArchitecture.pdf02-ProtocolArchitecture.pdf
02-ProtocolArchitecture.pdf
MiftaNurFarid2
 
TCP IP PowerPoint presentation download.
TCP IP PowerPoint presentation download.TCP IP PowerPoint presentation download.
TCP IP PowerPoint presentation download.
rp5373568
 
More on Tcp/Ip
More on Tcp/IpMore on Tcp/Ip
More on Tcp/Ip
Rakhi Saxena
 
Communication Networks 1
Communication Networks 1Communication Networks 1
Communication Networks 1
mahamed Ayesh
 
Internet1
Internet1Internet1
Internet1
Joseph Lagod
 
Osi model
Osi modelOsi model
Osi model
dhawal mehta
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- final
Taymoor Nazmy
 
Ta 104-tcp
Ta 104-tcpTa 104-tcp
Ta 104-tcp
Nitesh Singh
 
pppppppppppppppppjjjjjjjjjjjpppppppp.pptx
pppppppppppppppppjjjjjjjjjjjpppppppp.pptxpppppppppppppppppjjjjjjjjjjjpppppppp.pptx
pppppppppppppppppjjjjjjjjjjjpppppppp.pptx
zeyadosama505
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
Ahmed Elnaggar
 
Lecture 3- tcp-ip
Lecture  3- tcp-ipLecture  3- tcp-ip
Lecture 3- tcp-ip
Saman M. Almufti
 
Aplication and Transport layer- a practical approach
Aplication and Transport layer-  a practical approachAplication and Transport layer-  a practical approach
Aplication and Transport layer- a practical approach
Sarah R. Dowlath
 

Similar to Process Management - Part3 (20)

U5CSS3 (1).pdf
U5CSS3 (1).pdfU5CSS3 (1).pdf
U5CSS3 (1).pdf
 
TCP/IP Introduction
TCP/IP IntroductionTCP/IP Introduction
TCP/IP Introduction
 
presentation on TCP/IP protocols data comunications
presentation on TCP/IP protocols data comunicationspresentation on TCP/IP protocols data comunications
presentation on TCP/IP protocols data comunications
 
TCP/IP Modal
TCP/IP ModalTCP/IP Modal
TCP/IP Modal
 
OSI Layers
OSI LayersOSI Layers
OSI Layers
 
02 protocol architecture
02 protocol architecture02 protocol architecture
02 protocol architecture
 
Wireshark - Basics
Wireshark - BasicsWireshark - Basics
Wireshark - Basics
 
CN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdfCN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdf
 
02-ProtocolArchitecture.pdf
02-ProtocolArchitecture.pdf02-ProtocolArchitecture.pdf
02-ProtocolArchitecture.pdf
 
TCP IP PowerPoint presentation download.
TCP IP PowerPoint presentation download.TCP IP PowerPoint presentation download.
TCP IP PowerPoint presentation download.
 
More on Tcp/Ip
More on Tcp/IpMore on Tcp/Ip
More on Tcp/Ip
 
Communication Networks 1
Communication Networks 1Communication Networks 1
Communication Networks 1
 
Internet1
Internet1Internet1
Internet1
 
Osi model
Osi modelOsi model
Osi model
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- final
 
Ta 104-tcp
Ta 104-tcpTa 104-tcp
Ta 104-tcp
 
pppppppppppppppppjjjjjjjjjjjpppppppp.pptx
pppppppppppppppppjjjjjjjjjjjpppppppp.pptxpppppppppppppppppjjjjjjjjjjjpppppppp.pptx
pppppppppppppppppjjjjjjjjjjjpppppppp.pptx
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
Lecture 3- tcp-ip
Lecture  3- tcp-ipLecture  3- tcp-ip
Lecture 3- tcp-ip
 
Aplication and Transport layer- a practical approach
Aplication and Transport layer-  a practical approachAplication and Transport layer-  a practical approach
Aplication and Transport layer- a practical approach
 

Recently uploaded

Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 

Recently uploaded (20)

Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 

Process Management - Part3

  • 1. Processes (Part III) Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 1 / 50
  • 2. Inter-Process Communication (IPC) Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 2 / 50
  • 3. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 3 / 50
  • 4. Socket Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 4 / 50
  • 5. Let’s First Review The Basic Concepts of TCP/IP Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 5 / 50
  • 6. Internetworking An internetwork (internet (with a lowercase i)) is a network of com- puter networks. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 6 / 50
  • 7. Internetworking An internetwork (internet (with a lowercase i)) is a network of com- puter networks. Subnetwork refers to one of the networks composing an internet. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 6 / 50
  • 8. Internetworking An internetwork (internet (with a lowercase i)) is a network of com- puter networks. Subnetwork refers to one of the networks composing an internet. An internet aims to hide the details of different physical networks, to present a unified network architecture. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 6 / 50
  • 9. The Internet TCP/IP has become the dominant protocol for the internetworking. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 7 / 50
  • 10. The Internet TCP/IP has become the dominant protocol for the internetworking. The Internet (with an uppercase I) refers to the TCP/IP internet that connects millions of computers globally. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 7 / 50
  • 11. The Internet TCP/IP has become the dominant protocol for the internetworking. The Internet (with an uppercase I) refers to the TCP/IP internet that connects millions of computers globally. The first widespread implementation of TCP/IP appeared with 4.2BSD in 1983. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 7 / 50
  • 12. Networking Protocols and Layers A networking protocol is a set of rules defining how information is to be transmitted across a network. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
  • 13. Networking Protocols and Layers A networking protocol is a set of rules defining how information is to be transmitted across a network. Networking protocols are generally organized as a series of layers. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
  • 14. Networking Protocols and Layers A networking protocol is a set of rules defining how information is to be transmitted across a network. Networking protocols are generally organized as a series of layers. Each layer building on the layer below it to add features that are made available to higher layers. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
  • 15. Networking Protocols and Layers A networking protocol is a set of rules defining how information is to be transmitted across a network. Networking protocols are generally organized as a series of layers. Each layer building on the layer below it to add features that are made available to higher layers. Transparency: each protocol layer shields higher layers from the operation and complexity of lower layers. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 8 / 50
  • 16. TCP/IP Protocol Suite The TCP/IP protocol suite is a layered networking protocol. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 9 / 50
  • 17. TCP/IP Protocol Layers Data-Link layer Network layer (IP) Transport layer (TCP, UDP) Application Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 10 / 50
  • 18. Encapsulation Encapsulation: the information passed from a higher layer to a lower layer is treated as opaque data by the lower layer. • The lower layer does not interpret information from the upper layer. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 11 / 50
  • 19. Encapsulation Encapsulation: the information passed from a higher layer to a lower layer is treated as opaque data by the lower layer. • The lower layer does not interpret information from the upper layer. When data is passed up from a lower layer to a higher layer, a converse unpacking process takes place. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 11 / 50
  • 20. Data-Link Layer (1/3) It is concerned with transferring data across a physical link in a network. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 12 / 50
  • 21. Data-Link Layer (1/3) It is concerned with transferring data across a physical link in a network. It consists of the device driver and the hardware interface (network card) to the underlying physical medium, e.g., fiber-optic cable. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 12 / 50
  • 22. Data-Link Layer (2/3) The data-link layer encapsulates datagrams from the network layer into units, called frames. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 13 / 50
  • 23. Data-Link Layer (2/3) The data-link layer encapsulates datagrams from the network layer into units, called frames. It also adds each frame a header containing the destination address and frame size. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 13 / 50
  • 24. Data-Link Layer (2/3) The data-link layer encapsulates datagrams from the network layer into units, called frames. It also adds each frame a header containing the destination address and frame size. The data-link layer transmits the frames across the physical link and handles acknowledgements from the receiver. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 13 / 50
  • 25. Data-Link Layer (3/3) From an application-programming point of view, we can generally ignore the data-link layer, since all communication details are han- dled in the driver and hardware. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 14 / 50
  • 26. Data-Link Layer (3/3) From an application-programming point of view, we can generally ignore the data-link layer, since all communication details are han- dled in the driver and hardware. Maximum Transmission Unit (MTU): the upper limit that the layer places on the size of a frame. • data-link layers have different MTUs. netstat -i Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 14 / 50
  • 27. Network Layer (1/4) It is concerned with delivering data from the source host to the destination host. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 15 / 50
  • 28. Network Layer (1/4) It is concerned with delivering data from the source host to the destination host. It tasks include: • Breaking data into fragments small enough for transmission via the data-link layer. • Routing data across the internet. • Providing services to the transport layer. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 15 / 50
  • 29. Network Layer (1/4) It is concerned with delivering data from the source host to the destination host. It tasks include: • Breaking data into fragments small enough for transmission via the data-link layer. • Routing data across the internet. • Providing services to the transport layer. In the TCP/IP protocol suite, the principal protocol in the network layer is IP. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 15 / 50
  • 30. Network Layer (2/4) IP transmits data in the form of packets. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 16 / 50
  • 31. Network Layer (2/4) IP transmits data in the form of packets. Each packet sent between two hosts travels independently across the network. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 16 / 50
  • 32. Network Layer (2/4) IP transmits data in the form of packets. Each packet sent between two hosts travels independently across the network. An IP packet includes a header that contains the address of the source and target hosts. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 16 / 50
  • 33. Network Layer (3/4) IP is a connectionless protocol: it does not provide a virtual circuit connecting two hosts. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 17 / 50
  • 34. Network Layer (3/4) IP is a connectionless protocol: it does not provide a virtual circuit connecting two hosts. IP is an unreliable protocol: it makes a best effort to transmit data- grams from the sender to the receiver, but it does not guarantee: • that packets will arrive in the order they were transmitted, • that they will not be duplicated, • that they will arrive at all. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 17 / 50
  • 35. Network Layer (4/4) An IP address consists of two parts: • Network ID: specifies the network on which a host resides. • Host ID: identifies the host within that network. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 18 / 50
  • 36. Network Layer (4/4) An IP address consists of two parts: • Network ID: specifies the network on which a host resides. • Host ID: identifies the host within that network. An IPv4 address consists of 32 bits: 204.152.189.0/24 • loopback 127.0.0.1 refers to system on which process is running. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 18 / 50
  • 37. Network Layer (4/4) An IP address consists of two parts: • Network ID: specifies the network on which a host resides. • Host ID: identifies the host within that network. An IPv4 address consists of 32 bits: 204.152.189.0/24 • loopback 127.0.0.1 refers to system on which process is running. Network mask: a sequence of 1s in the leftmost bits, followed by a sequence of 0s • The 1s indicate which part of the address contains the assigned network ID. • The 0s indicate which part of the address is available to assign as host IDs. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 18 / 50
  • 38. Transport Layer (1/5) Transport protocol provides an end-to-end communication service to applications residing on different hosts. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 19 / 50
  • 39. Transport Layer (1/5) Transport protocol provides an end-to-end communication service to applications residing on different hosts. Two widely used transport-layer protocols in the TCP/IP suite: • User Datagram Protocol (UDP): the protocol used for datagram sockets. • Transmission Control Protocol (TCP): the protocol used for stream sockets. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 19 / 50
  • 40. Transport Layer (2/5) Port: a method of differentiating the applications on a host. • 16-bit number Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 20 / 50
  • 41. Transport Layer (2/5) Port: a method of differentiating the applications on a host. • 16-bit number • All ports below 1024 are well known, used for standard services, e.g., http: 80, ssh: 22. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 20 / 50
  • 42. Transport Layer (2/5) Port: a method of differentiating the applications on a host. • 16-bit number • All ports below 1024 are well known, used for standard services, e.g., http: 80, ssh: 22. • Shown as 192.168.1.1:8080. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 20 / 50
  • 43. Transport Layer (3/5) UDP, like IP, is connectionless and unreliable. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 21 / 50
  • 44. Transport Layer (3/5) UDP, like IP, is connectionless and unreliable. If an application layered on top of UDP requires reliability, then this must be implemented within the application. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 21 / 50
  • 45. Transport Layer (3/5) UDP, like IP, is connectionless and unreliable. If an application layered on top of UDP requires reliability, then this must be implemented within the application. UDP adds just two features to IP: • Port number • Data checksum to allow the detection of errors in the transmitted data. [http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm] Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 21 / 50
  • 46. Transport Layer (4/5) TCP provides a reliable, connection-oriented, bidirectional, byte- stream communication channel between two endpoints. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 22 / 50
  • 47. Transport Layer (4/5) TCP provides a reliable, connection-oriented, bidirectional, byte- stream communication channel between two endpoints. Before communication can commence, TCP establishes a commu- nication channel between the two endpoints. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 22 / 50
  • 48. Transport Layer (5/5) In TCP, data is broken into segments: each is transmitted in a single IP packet. [http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm] Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 23 / 50
  • 49. Transport Layer (5/5) In TCP, data is broken into segments: each is transmitted in a single IP packet. When a destination receives a TCP segment, it sends an ack. to the sender, informing weather it received the segment correctly or not. [http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm] Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 23 / 50
  • 50. Transport Layer (5/5) In TCP, data is broken into segments: each is transmitted in a single IP packet. When a destination receives a TCP segment, it sends an ack. to the sender, informing weather it received the segment correctly or not. Other features of TCP: • Sequencing • Flow control • Congestion control [http://www.tamos.net/∼rhay/overhead/ip-packet-overhead.htm] Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 23 / 50
  • 51. OK, Let’s Back to Socket Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 24 / 50
  • 52. Socket A socket is defined as an endpoint for communication. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 25 / 50
  • 53. Socket A socket is defined as an endpoint for communication. A typical client-server scenario: • Each process creates a socket: both processes require one. • The server binds its socket to a well-known address (name) so that clients can locate it. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 25 / 50
  • 54. Creating a Socket socket() creates a new socket. #include <sys/socket.h> int socket(int domain, int type, int protocol); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 26 / 50
  • 55. Socket Domains The UNIX domain (AF UNIX) • Communication between processes on the same host (within the kernel). • Address format: path name. int socket(int domain, int type, int protocol); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 27 / 50
  • 56. Socket Domains The UNIX domain (AF UNIX) • Communication between processes on the same host (within the kernel). • Address format: path name. The IPV4 domain (AF INET) • Communication between processes running on hosts connected via an IPv4 network. • Address format: 32-bit IPv4 address + 16-bit port number. int socket(int domain, int type, int protocol); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 27 / 50
  • 57. Socket Types Stream sockets (SOCK STREAM) • It provides a reliable, bidirectional, byte-stream communication channel. • Called connection-oriented. int socket(int domain, int type, int protocol); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 28 / 50
  • 58. Socket Types Stream sockets (SOCK STREAM) • It provides a reliable, bidirectional, byte-stream communication channel. • Called connection-oriented. Datagram sockets (SOCK DGRAM) • Allow data to be exchanged in the form of messages called datagrams. • Called connectionless. int socket(int domain, int type, int protocol); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 28 / 50
  • 59. Binding a Socket to an Address bind() binds a socket to an address. #include <sys/socket.h> int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 29 / 50
  • 60. Listening for Incoming Connections listen() marks the stream socket passive. The socket will subsequently be used to accept connections from other (active) sockets. #include <sys/socket.h> int listen(int sockfd, int backlog); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 30 / 50
  • 61. Accepting a Connection accept() accepts an incoming connection on the listening stream socket. If there are no pending connections when accept() is called, the call blocks until a connection request arrives. #include <sys/socket.h> int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 31 / 50
  • 62. Connecting to a Peer Socket connect() connects the active socket to the listening socket whose address is specified by addr and addrlen. #include <sys/socket.h> int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 32 / 50
  • 63. Stream Sockets Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 33 / 50
  • 64. Producer-Consumer vi Stream Socket (1/2) Producer (Server) int sockfd, connfd; struct sockaddr_in serv_addr, cli_addr; socklen_t cli_len; char buffer[256]; bzero(&serv_addr, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(32000); sockfd = socket(AF_INET, SOCK_STREAM, 0); bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); listen(sockfd, 5); cli_len = sizeof(cli_addr); connfd = accept(sockfd, (struct sockaddr *)&cli_addr, &cli_len); read(connfd, buffer, 255); write(connfd, "I got your message", 18); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 34 / 50
  • 65. Producer-Consumer vi Stream Socket (2/2) Consumer (Client) int sockfd, connfd; struct sockaddr_in serv_addr, cli_addr; socklen_t clilen; char *buf = "hello"; char rec_buf[256]; bzero(&serv_addr,sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = inet_addr("x.x.x.x"); serv_addr.sin_port = htons(32000); sockfd = socket(AF_INET, SOCK_STREAM, 0); connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); write(sockfd, buf, strlen(buf)); read(sockfd, recv_buf, 255); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 35 / 50
  • 66. Internet Socket Addresses An IPv4 socket address is stored in a sockaddr in structure, defined in <netinet/in.h>. int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); struct sockaddr { sa_family_t sa_family; // Address family (AF_* constant) char sa_data[14]; // Socket address }; struct sockaddr_in { // IPv4 socket address sa_family_t sin_family; // Address family (AF_INET) in_port_t sin_port; // Port number struct in_addr sin_addr; // IPv4 address unsigned char _pad[X]; // Pad to size of ’sockaddr’ structure (16 bytes) }; struct in_addr { // IPv4 4-byte address in_addr_t s_addr; // Unsigned 32-bit integer }; Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 36 / 50
  • 67. Datagram Sockets Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 37 / 50
  • 68. Exchanging Datagrams recvfrom() and sendto() receive and send datagrams on a data- gram socket. #include <sys/socket.h> ssize_t sendto(int sockfd, const void *buffer, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); ssize_t recvfrom(int sockfd, void *buffer, size_t length, int flags, struct sockaddr *src_addr, socklen_t *addrlen); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 38 / 50
  • 69. Producer-Consumer vi Datagram Socket (1/2) Producer (Server) int sockfd, n; struct sockaddr_in serv_addr, cli_addr; socklen_t cli_len; char buf[256]; bzero(&serv_addr, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(32000); sockfd = socket(AF_INET, SOCK_DGRAM, 0); bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); cli_len = sizeof(cli_addr); n = recvfrom(sockfd, buf, 255, 0, (struct sockaddr *)&cli_addr, &cli_len); sendto(sockfd, buf, n, 0, (struct sockaddr *)&cli_addr,sizeof(cli_addr)); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 39 / 50
  • 70. Producer-Consumer vi Datagram Socket (2/2) Consumer (Client) int sockfd, connfd; struct sockaddr_in serv_addr, cli_addr; socklen_t clilen; char *buf = "hello"; char recv_buf[256]; bzero(&serv_addr,sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = inet_addr("x.x.x.x"); serv_addr.sin_port = htons(32000); sockfd = socket(AF_INET, SOCK_DGRAM, 0); sendto(sockfd, buf, strlen(buf), 0, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); recvfrom(sockfd, recv_buf, 255, 0, NULL, NULL); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 40 / 50
  • 71. Signals Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 41 / 50
  • 72. Signals (1/2) Signals are software interrupts to notify a process that a particular event has occurred. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 42 / 50
  • 73. Signals (1/2) Signals are software interrupts to notify a process that a particular event has occurred. These events can originate from outside the system, e.g., by pressing Ctrl-C, or when a process executes code that divides by zero. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 42 / 50
  • 74. Signals (1/2) Signals are software interrupts to notify a process that a particular event has occurred. These events can originate from outside the system, e.g., by pressing Ctrl-C, or when a process executes code that divides by zero. As a primitive form of IPC, one process can also send a signal to another process. ps -aux | grep acrobat amir 7302 0.0 0.0 ... kill -9 7302 Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 42 / 50
  • 75. Signals (2/2) A signal handler is used to process signals. 1 Signal is generated by particular event. 2 Signal is delivered to a process. 3 Signal is handled by one of two signal handlers: default or user-defined. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 43 / 50
  • 76. Signals (2/2) A signal handler is used to process signals. 1 Signal is generated by particular event. 2 Signal is delivered to a process. 3 Signal is handled by one of two signal handlers: default or user-defined. Every signal has default handler that kernel runs when handling signal User-defined signal handler can override default. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 43 / 50
  • 77. Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 44 / 50
  • 78. Signal Management signal() removes the current action taken on receipt of the sig- nal signo and instead handles the signal with the signal handler specified by handler. #include <signal.h> typedef void (*sighandler_t)(int); sighandler_t signal(int signo, sighandler_t handler); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 45 / 50
  • 79. Waiting for a Signal pause() puts a process to sleep until it receives a signal. #include <unistd.h> int pause(void); Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 46 / 50
  • 80. Signal Example // handler for SIGINT static void sigint_handler(int signo) { printf("Caught SIGINT!n"); exit(0); } int main(void) { // Register sigint_handler as our signal handler for SIGINT. if (signal(SIGINT, sigint_handler) == SIG_ERR) exit(1); pause(); return 0; } Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 47 / 50
  • 81. Summary Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 48 / 50
  • 82. Summary TCP-IP protocol layers: data-link, network, transport, application Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
  • 83. Summary TCP-IP protocol layers: data-link, network, transport, application Data-link: network card Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
  • 84. Summary TCP-IP protocol layers: data-link, network, transport, application Data-link: network card Network layer: routing, IP, 32-bit address, 16-bit port Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
  • 85. Summary TCP-IP protocol layers: data-link, network, transport, application Data-link: network card Network layer: routing, IP, 32-bit address, 16-bit port Transport layer: TCP (stream, connection-oriented), UDP (data- gram, connectionless) Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
  • 86. Summary TCP-IP protocol layers: data-link, network, transport, application Data-link: network card Network layer: routing, IP, 32-bit address, 16-bit port Transport layer: TCP (stream, connection-oriented), UDP (data- gram, connectionless) Sockets Signal: software interrupts Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 49 / 50
  • 87. Questions? Amir H. Payberah (Tehran Polytechnic) Processes 1393/7/7 50 / 50