0% found this document useful (0 votes)
50 views3 pages

Itss Lab6

This document contains the responses to 5 questions asked as part of a lab experiment on IT system security. The responses discuss sockets and how race conditions occur, multiprogramming, the seven layers of the OSI model, advantages and disadvantages of Java sockets, and includes a Python code sample to capture network traffic and write it to a PCAP file.

Uploaded by

MANSI BISHT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views3 pages

Itss Lab6

This document contains the responses to 5 questions asked as part of a lab experiment on IT system security. The responses discuss sockets and how race conditions occur, multiprogramming, the seven layers of the OSI model, advantages and disadvantages of Java sockets, and includes a Python code sample to capture network traffic and write it to a PCAP file.

Uploaded by

MANSI BISHT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MURALI NARAYAN 15 APRIL 2020

R134217089 B TECH CSE CSF B2 SEM 6


500061575 SUBMITTED TO: DR. ADARSH KUMAR
IT SYSTEM SECURITY LABORATORY EXPERIMENT NO. 6

Q1 What Is Socket? How Does The Race Condition Occur?


Ans. Sockets allow communication between two different processes on the same or different machines.
Sockets are commonly used for client and server interaction. Typical system configuration places the server
on one machine, with the clients on other machines. The clients connect to the server, exchange information,
and then disconnect. A race condition occurs when there are two or more processes trying to access the
same data concurrently or performing the same operation concurrently. Output of the operation depends on
the sequence of requests of the operations.
Q2 What Is Multiprogramming?
Ans. Multiprogramming is the process of running multiple programs at the same time. This way, the
operating system makes use of the system’s processing power. The operating system executes part of one
program, then part of another, and so on. To the user it appears that all programs are executing at the same
time.
If the machine has the capability of causing an interrupt after a specified time interval, then the operating
system will execute each program for a given length of time, regain control, and then execute another
program for a given length of time, and so on.
Q3 Name The Seven Layers Of The OSI Model And Describe Them Briefly?
Ans. Seven layers of OSI model:
1. Application layer: this layer is the topmost layer and is responsible for providing the services to the
user. Ex: HTTP, HTTPS, SMTP, FTP, IP, DNS, Telnet…etc. This layer is also called the end user
layer.
2. Presentation layer: this layer is responsible for translation, encryption and compression of data sent
from the lower layers, which is intended for the upper layer. Ex: SSL, SSH, TSL, MPEG, JPEG…etc.
This layer is also called the syntax layer.
3. Session Layer: this layer is responsible for establishing, managing and terminating the
sessions/connections created between the client(s) and the server(s). Ex: API, sockets…etc.
4. Transport layer: this layer is responsible for process to process communication and delivery of
messages. It’s known as end-to-end layer. Ex: TCP, UDP…etc.
5. Network layer: this layer is responsible for delivery of packets from node to node. It’s also
responsible for addressing – physical and logical – of the devices. Ex: IPv4, IPv6, ICMP, IGMP,
IPSec…etc
6. Data link layer: this layer is responsible for error free delivery of frames from node to node, and also
defines the format of the data on the network. Ex: Ethernet, switches, bridges, hubs, repeaters…etc
7. Physical layer: this layer is responsible for the physical structure of the network, and transmits the
bits from one node to another. It also specifies the mechanical, electrical and procedural network
interface specifications…etc.
Q4 What are the seven layers of the OSI Model of networking? What are some advantages and
disadvantages of Java sockets?
Ans. Seven layers of OSI model:
 Application layer
 Presentation layer
 Session layer
 Network layer
 Transport layer
 Data link layer
 Physical layer
Advantages of Java sockets:
 Flexible and powerful.
 Cause low network traffic if efficiently used.
 Only updated information can be sent.
Disadvantages of Java sockets:
 The Java applets can establish communication only with the machine requested and not with any
other machine on the network.
 Sockets allow only raw data to be sent. This means that both client and server need to have
mechanisms to interpret the data.

Q5 Write a simple Java/python/C++ or any language cope to capture network traffic and write in
PCAP file.
Ans.
Parsing a PCAP file in python:
import argparse
import os
import sys

def process_pcap(file_name):
print('Opening {}...'.format(file_name))

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='PCAP reader')
parser.add_argument('--pcap', metavar='<pcap file name>',
help='pcap file to parse', required=True)
args = parser.parse_args()
file_name = args.pcap
if not os.path.isfile(file_name):
print('"{}" does not exist'.format(file_name), file=sys.stderr)
sys.exit(-1)
process_pcap(file_name)
sys.exit(0)

You might also like