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

CCN Lab Assign 3

The document contains the answers to three questions regarding computer communication and networks. It defines the protocols used in each layer of the OSI model and provides examples. It describes the purpose of network traffic analysis and lists 10 packet types. It defines network programming and web scraping, and explains how HTTP requests are used to access web pages. It also provides code to scrape data from two websites and store it in a JSON or CSV file.

Uploaded by

sana faiz
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 views7 pages

CCN Lab Assign 3

The document contains the answers to three questions regarding computer communication and networks. It defines the protocols used in each layer of the OSI model and provides examples. It describes the purpose of network traffic analysis and lists 10 packet types. It defines network programming and web scraping, and explains how HTTP requests are used to access web pages. It also provides code to scrape data from two websites and store it in a JSON or CSV file.

Uploaded by

sana faiz
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/ 7

Assignment# 03

Computer communication
& networks
(lab)
Submitted to:
Sir shoiab
Submitted by:
Sana faiz
Reg # sp17-bcs-064
Question No 1: Define the different protocols used in all layers of OSI models. Following
are the elements which you must cover of each protocol: -
Name and short description - Practical application (i.e. Networks type) - Pros and cons.
Implement three routing protocols which are: RIP, OSPF and EIGRP on any network
topology.
ANS:

OSI Layer Name Common Protocols


7 Application HTTP | FTP | SMTP | DNS | Telnet
6 Presentation
5 Session
4 Transport TCP | SPX
3 Network IP | IPX
2 Data Link
Ethernet
1 Physical

IP and IPX (Network Layer)


Networks using the IP and IPX protocols assign logical addresses (which are made up of the
MAC address and the network address) to the devices on the network, This can all become
quite complex -- suffice it to say that the network layer takes care of assigning the correct
addresses (via IP or IPX) and then uses routers to send the data packets to other networks
TCP and SPX (Transport Layer)
When the data packets are sent over a network, they may or may not take the same route -- it
doesn't matter. At the receiving end, the data packets are re-assembled into the proper order.
After all packets are received, a message goes back to the originating network. If a packet
does not arrive, a message to "re-send" is sent back to the originating network.
TCP, paired with IP, is by far the most popular protocol at the transport level. If the IPX
protocol is used at the network layer (on networks such as Novell or Microsoft), then it is
paired with SPX at the transport layer.
HTTP, FTP, SMTP and DNS (Session/Presentation/Application Layers)

Several protocols overlap the session, presentation, and application layers of networks. There
protocols listed below are a few of the more well-known:

 DNS - Domain Name System - translates network address (such as IP addresses) into terms
understood by humans (such as Domain Names) and vice-versa
 DHCP - Dynamic Host Configuration Protocol - can automatically assign Internet addresses
to computers and users
 FTP - File Transfer Protocol - a protocol that is used to transfer and manipulate files on the
Internet
 HTTP – Hyper Text Transfer Protocol - An Internet-based protocol for sending and receiving
webpages
 IMAP - Internet Message Access Protocol - A protocol for e-mail messages on the Internet
 IRC - Internet Relay Chat - a protocol used for Internet chat and other communications
 POP3 - Post Office protocol Version 3 - a protocol used by e-mail clients to retrieve messages
from remote servers
 SMTP - Simple Mail Transfer Protocol - A protocol for e-mail messages on the Internet
Question No 2: What is the purpose of network traffic analysis? Capture ten different
types of packets which implementing application and network layer protocols.
Complete the given Lab manual with your implemented networks results.

ANS:

Network traffic analysis is the process of recording, reviewing and analysing network traffic for the
purpose of performance, security and/or general network operations and management.
 Network security staff uses network traffic analysis to identify any malicious or suspicious
packets within the traffic. Similarly, network administrations seek to monitor
download/upload speeds, throughput, content, etc. to understand network operations.
 Network traffic analysis helps in monitoring all activities within the network, not just at the
perimeter, but also between endpoints and servers.
 Network traffic analysis is an effective tool in making extracting data harder for hackers. It
helps the company detect cyber threats with a higher degree of certainty, thereby enabling
them to eliminate security threats better and faster.

Question No 3:
i. What is Network programming? Define fundamentals of socket programming
with diagrams. What is Web Scrapping and why we need to scrap data. How
HTTP requests are used to access web pages?
ii. Scrap any two websites data including title, paragraphs, headings, links and
image sources. Then store the scraped data into permanent storage like Json or
CSV. Implement using python to read this data and clean the whole data for
further analysis.
ANS:
Network programming: It involves writing programs that communicate with other programs
across a computer network.

Web Scraping is a technique of extracting/scraping information from websites. This technique


mostly focuses on the transformation of unstructured data (HTML format) on the web into structured
data.

Why we need to scrap data?


Web scraping, or web content extraction, can serve an unlimited number of purposes.

 Automation of data
 Retrieval of dynamic and static web pages
 Transformation of page contents
 Quick recognition of semantic annotation
 Collection of accurate & reliable data
 Easy price analysis
 Develop business intelligence

How HTTP requests are used to access web pages?


When you type a URL into a web browser, this is what happens:
1. If the URL contains a domain name, the browser first connects to a domain name server and
retrieves the corresponding IP address for the web server.
2. The web browser connects to the web server and sends an HTTP request (via the protocol
stack) for the desired web page.
3. The web server receives the request and checks for the desired page. If the page exists, the
web server sends it. If the server cannot find the requested page, it will send an HTTP 404
error message. (404 means 'Page Not Found' as anyone who has surfed the web probably
knows.)
4. The web browser receives the page back and the connection is closed.
5. The browser then parses through the page and looks for other page elements it needs to
complete the web page. These usually include images, applets, etc.
6. For each element needed, the browser makes additional connections and HTTP requests to the
server for each element.
7. When the browser has finished loading all images, applets, etc. the page will be completely
loaded in the browser window.

You might also like