SlideShare a Scribd company logo
1 of 2
Download to read offline
Programming Assignment #3 CSCE 3530 - Introduction to Computer Networks Spring 2023 100
Points Due: 03/29/2023, 11:55 PM Instructions: Compile the C programs in one of the Cell (cell01
- cell06) servers and make sure it's working. Comment your code. Create a Makefile to compile
the source code and to clean the executable. Create a readme file that describes how to compile,
execute, and test the code. Create an assignment folder with folder name as euid_PA3 (example:
xyz0202_PA3) and add the source file, Makefile, and the readme file to the folder. Please create a
zip archive of your assignment folder and upload the zip file to Canvas. Not following the above
instructions could result in not accepting your programming assignment. Late submissions are not
allowed. Objective: Create a web cache that can cache up to six recent webpages and checks if
the pages are up to date. Requirements: 1. Create a C-based client using TCP sockets 2. The
client should run on any Cell (cell01 - cell06) machine 3. The client should be able to accept and
service http requests 4. The client should be able to cache up to six recent requested webpages, if
available 5. The client should check if an updated webpage is available using If-Modified-Since
header and replace the old webpage with new webpage in the cache if a updated webpage is
available. Procedure: 1. Create a C-based client using TCP sockets 2. The client should run on
any Cell (cell01 - cell06) machine and the created client should be able to accept a HTTP website
URL using the below format / wcolient URL: Url> Port: 2023 Robin Polfathuparamoid Page 1 of
5where wcclient is the client executable, uri is the requested hostname and port_number is the
port number that the web server is listening 3. Once the client gets an URL input from the user, it
checks the cache for the requested page. If the page is not found in the cache, proceed to the
below steps a. The client makes a connection to the requested URL using the connect system call.
The connect system call needs the IP address of the input URL. Use the gethostbyname system
call to find the IP address of the input URL b. Once the connection is made, a GET request is
made to the web server by client program. Figure 1 shows the overall architecture c. A sample
GET request is shown below to request the landing page from google website GET / HTTP/2.1 /rn
Host: ww. google.com ln Connection: Closelrln rn d. The above GET request lines are packed as a
single string and written to the webserver by client using wri te or send system call e. The client
sleeps for a second and then reads (read or recv system call) the incoming stream of data
(response) and stores the received data in a buffer. The client then checks for the HTTP response
status code in the received response f. If the HTTP response status code is 200 , the retumed web
page from the web server is cached (stored as a file). Verify manually to see if the returned page
is same as the browser returned page g. The client stores the webpage in a file and assigns a
filename based on the time of visit (available in the response header). The filename format is
YYYYMMDDhhmmss. Where YYY is the year, MM is the month, DD is the day, hh is the hour in
24-hour format, mm is the minutes, and ss is the seconds when the website was visited h. A list
file (list.txt) is created which stores the URL of the webpage and the associated cached web page
filename i. The list file stores six recent URLs. The cached websites that are not listed in the list
file should be deleted from the cache j. Once the returned web page is cached, the client waits for
the next URL input from the user k. If the HTTP response status code is not 200, do not cache the
web page instead print the HTTP response status code4. When the user requests a webpage that
is in the list.txt file (cache) the client simply prints that the page is found in cache along with the
filename and proceeds to the below steps a. The client will ask the user to check if the page was
modified. If the user responds with a 'Yes', the user inputs the date and time to check if the page
was modified since the input date and time b. Do Step 3a for the connection and once the
connection is made, a GET request along with If-Modified-Since header is sent to the web server
to check if the page is modified since the input date and time c. A sample GET request with If-
Modified-Since header is shown below to request the updated page from example.com website
GET/HTTP/1.1In Host: ww. example.com r If-Modified-Since: Thu, 16 Oct 201907:18:26 GMT rn
Connection: Clogelr lnrn d. If the HTTP response status code is 200 , the returned web page from
the web server is cached (stored as a new file with filename based on the time of visit). The old,
cached file is deleted. The list file is updated accordingly with necessary changes e. If the HTTP
response status code is 304 , do not cache the web page instead print the HTTP response status
code f. If the user responds with a 'No' to check if the page was modified, then the client proceeds
to ask the user for the next URL 5. The client program should exit or end execution when a quit
expression is given as an input 6. Test web caching by accessing multiple websites. Most
websites are not http websites so only select http websites using this website 7. Most websites do
not support If-Modified-Since header, so use this website to check if a http website supports If-
Modified-Since header 8. A sample list.txt is available on Canvas for reference. Deliverables: 1.
Commented client C code 2. A Makefile to compile (make) the source code and to clean (make
clean) the executable 3. A readme file that describes how to compile, execute, and test the code.
4. Create an assignment folder with folder name as euid_PA3 (example: xyz0202_PA2) and add
the source file, Makefile, and the readme file to the folder. 92023 Rotin Pottathimarambil Page 3 of
5Please create a zip archive of your assignment folder and upload the zip file to Canvas on or
before due date. Client-side input/output: ./weclient URL: www google.com Port: 80 Response:
200 Action: Page cached as filename - 20230308101001 URL: www. dmoz.org Port: 80
Response: 400 Action: Not cached URL: ww. example.com Port: 80 Response: 200 Action: Page
cached as filename - 20230308101020 URL: 1cio.us Port: 80 Response: 200 Action: Page cached
as filename - 20230308101044 URL: wWW. example.com Port: 80 Response: 200 Action: Page
found in cache, filename - 20230308101020 Check if modified: Yes Date: Thu, 16 Oct 2019
07:18:26 GMT Response: 200 Action: Updated web page cached as filename - 20230308101110,
deleted old page with filename - 20230308101020 URL: Ww. example.com Port: 80 Response:
200 Action: Page found in cache, filename - 20230308101110 Check if modified: Yes Date: Thu,
18 Oct 201907:18:26 GMT Response: 304 Action: Not cached URL: www, example,com Port: 80
Response: 200 Action: Page found in cache, filename - 20230308111110 Check if modified: No
URL: quit cya!Figure 1. Overall Architecture.

More Related Content

Similar to Programming Assignment 3 CSCE 3530 Introduction to Comput.pdf

MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docxMCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docxalfredacavx97
 
Html intake 38 lect1
Html intake 38 lect1Html intake 38 lect1
Html intake 38 lect1ghkadous
 
API Testing Presentations.pptx
API Testing Presentations.pptxAPI Testing Presentations.pptx
API Testing Presentations.pptxManmitSalunke
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Syed Ariful Islam Emon
 
Introducing asp
Introducing aspIntroducing asp
Introducing aspaspnet123
 
This project explores usage of the IPC in the form of shared.pdf
This project explores usage of the IPC in the form of shared.pdfThis project explores usage of the IPC in the form of shared.pdf
This project explores usage of the IPC in the form of shared.pdfadinathfashion1
 
Active Server Page - ( ASP )
Active Server Page - ( ASP )Active Server Page - ( ASP )
Active Server Page - ( ASP )MohitJoshi154
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing ReportAman Srivastava
 
some fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTMLsome fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTMLfaiz324545
 
B14870 solution final
B14870 solution finalB14870 solution final
B14870 solution finalssuser8f0495
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Mario Cardinal
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...WebStackAcademy
 
Cache control directive
Cache control directiveCache control directive
Cache control directiveMohamed Mamoon
 

Similar to Programming Assignment 3 CSCE 3530 Introduction to Comput.pdf (20)

MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docxMCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
MCIS 6163 Assignment 1MCIS 6163 Assignment 1.pdfAssignmen.docx
 
Html intake 38 lect1
Html intake 38 lect1Html intake 38 lect1
Html intake 38 lect1
 
API Testing Presentations.pptx
API Testing Presentations.pptxAPI Testing Presentations.pptx
API Testing Presentations.pptx
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
 
Browser Security
Browser SecurityBrowser Security
Browser Security
 
This project explores usage of the IPC in the form of shared.pdf
This project explores usage of the IPC in the form of shared.pdfThis project explores usage of the IPC in the form of shared.pdf
This project explores usage of the IPC in the form of shared.pdf
 
Active Server Page - ( ASP )
Active Server Page - ( ASP )Active Server Page - ( ASP )
Active Server Page - ( ASP )
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing Report
 
PPT
PPTPPT
PPT
 
some fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTMLsome fundamental topics to remember when starting with HTML
some fundamental topics to remember when starting with HTML
 
B14870 solution final
B14870 solution finalB14870 solution final
B14870 solution final
 
Python cgi programming
Python cgi programmingPython cgi programming
Python cgi programming
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
5-WebServers.ppt
5-WebServers.ppt5-WebServers.ppt
5-WebServers.ppt
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 
Cgi
CgiCgi
Cgi
 
Play framework
Play frameworkPlay framework
Play framework
 
Cache control directive
Cache control directiveCache control directive
Cache control directive
 
Appl layer
Appl layerAppl layer
Appl layer
 

More from addtechglobalmarketi

Pundits have stated that the recent tax cut mainly benefits .pdf
Pundits have stated that the recent tax cut mainly benefits .pdfPundits have stated that the recent tax cut mainly benefits .pdf
Pundits have stated that the recent tax cut mainly benefits .pdfaddtechglobalmarketi
 
Pt is 76 year old with pneumonia and malnutrition Patient i.pdf
Pt is 76 year old with pneumonia and malnutrition Patient i.pdfPt is 76 year old with pneumonia and malnutrition Patient i.pdf
Pt is 76 year old with pneumonia and malnutrition Patient i.pdfaddtechglobalmarketi
 
Punto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdf
Punto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdfPunto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdf
Punto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdfaddtechglobalmarketi
 
Pulse can be palpated on a number of arteries around the bod.pdf
Pulse can be palpated on a number of arteries around the bod.pdfPulse can be palpated on a number of arteries around the bod.pdf
Pulse can be palpated on a number of arteries around the bod.pdfaddtechglobalmarketi
 
Punnett Squares se puede extender ms all de un simple cruc.pdf
Punnett Squares se puede extender ms all de un simple cruc.pdfPunnett Squares se puede extender ms all de un simple cruc.pdf
Punnett Squares se puede extender ms all de un simple cruc.pdfaddtechglobalmarketi
 
pular Madde 5 Aadaki durumda orijinal kaynak materyal b.pdf
pular  Madde 5  Aadaki durumda orijinal kaynak materyal b.pdfpular  Madde 5  Aadaki durumda orijinal kaynak materyal b.pdf
pular Madde 5 Aadaki durumda orijinal kaynak materyal b.pdfaddtechglobalmarketi
 
Puede crear numerosas vistas personalizadas para usar con to.pdf
Puede crear numerosas vistas personalizadas para usar con to.pdfPuede crear numerosas vistas personalizadas para usar con to.pdf
Puede crear numerosas vistas personalizadas para usar con to.pdfaddtechglobalmarketi
 
publie elass h 1 pahlte clamsia axcends A pablie clann Main .pdf
publie elass h 1 pahlte clamsia axcends A pablie clann Main .pdfpublie elass h 1 pahlte clamsia axcends A pablie clann Main .pdf
publie elass h 1 pahlte clamsia axcends A pablie clann Main .pdfaddtechglobalmarketi
 
Puede una empresa ser buena en responsabilidad social corpo.pdf
Puede una empresa ser buena en responsabilidad social corpo.pdfPuede una empresa ser buena en responsabilidad social corpo.pdf
Puede una empresa ser buena en responsabilidad social corpo.pdfaddtechglobalmarketi
 
public class Monster protected String clanAffiliation pro.pdf
public class Monster  protected String clanAffiliation pro.pdfpublic class Monster  protected String clanAffiliation pro.pdf
public class Monster protected String clanAffiliation pro.pdfaddtechglobalmarketi
 
Provide three evidences with scholar reference that support.pdf
Provide three evidences with scholar  reference that support.pdfProvide three evidences with scholar  reference that support.pdf
Provide three evidences with scholar reference that support.pdfaddtechglobalmarketi
 
Provincial Government The name of the representative of the .pdf
Provincial Government The name of the representative of the .pdfProvincial Government The name of the representative of the .pdf
Provincial Government The name of the representative of the .pdfaddtechglobalmarketi
 
Prpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdf
Prpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdfPrpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdf
Prpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdfaddtechglobalmarketi
 
Provide three evidences with reliable reference that suppor.pdf
Provide three evidences with reliable  reference that suppor.pdfProvide three evidences with reliable  reference that suppor.pdf
Provide three evidences with reliable reference that suppor.pdfaddtechglobalmarketi
 
Provide the Independent variables Dependent variables a.pdf
Provide the Independent variables Dependent variables a.pdfProvide the Independent variables Dependent variables a.pdf
Provide the Independent variables Dependent variables a.pdfaddtechglobalmarketi
 
Provide your example of a firm or a small business from the .pdf
Provide your example of a firm or a small business from the .pdfProvide your example of a firm or a small business from the .pdf
Provide your example of a firm or a small business from the .pdfaddtechglobalmarketi
 
Provide the steps for the following In order to install sof.pdf
Provide the steps for the following In order to install sof.pdfProvide the steps for the following In order to install sof.pdf
Provide the steps for the following In order to install sof.pdfaddtechglobalmarketi
 
Provide land use land cover images and photos using shape.pdf
Provide land use land cover images and photos  using shape.pdfProvide land use land cover images and photos  using shape.pdf
Provide land use land cover images and photos using shape.pdfaddtechglobalmarketi
 
Provide SQL that creates two database tables Employee and D.pdf
Provide SQL that creates two database tables Employee and D.pdfProvide SQL that creates two database tables Employee and D.pdf
Provide SQL that creates two database tables Employee and D.pdfaddtechglobalmarketi
 

More from addtechglobalmarketi (20)

Pundits have stated that the recent tax cut mainly benefits .pdf
Pundits have stated that the recent tax cut mainly benefits .pdfPundits have stated that the recent tax cut mainly benefits .pdf
Pundits have stated that the recent tax cut mainly benefits .pdf
 
Pt is 76 year old with pneumonia and malnutrition Patient i.pdf
Pt is 76 year old with pneumonia and malnutrition Patient i.pdfPt is 76 year old with pneumonia and malnutrition Patient i.pdf
Pt is 76 year old with pneumonia and malnutrition Patient i.pdf
 
Punto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdf
Punto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdfPunto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdf
Punto 13 Punto 13 Mindy se adapt rpidamente a su puesto en.pdf
 
Pulse can be palpated on a number of arteries around the bod.pdf
Pulse can be palpated on a number of arteries around the bod.pdfPulse can be palpated on a number of arteries around the bod.pdf
Pulse can be palpated on a number of arteries around the bod.pdf
 
Puntaje Puntaje.pdf
Puntaje            Puntaje.pdfPuntaje            Puntaje.pdf
Puntaje Puntaje.pdf
 
Punnett Squares se puede extender ms all de un simple cruc.pdf
Punnett Squares se puede extender ms all de un simple cruc.pdfPunnett Squares se puede extender ms all de un simple cruc.pdf
Punnett Squares se puede extender ms all de un simple cruc.pdf
 
pular Madde 5 Aadaki durumda orijinal kaynak materyal b.pdf
pular  Madde 5  Aadaki durumda orijinal kaynak materyal b.pdfpular  Madde 5  Aadaki durumda orijinal kaynak materyal b.pdf
pular Madde 5 Aadaki durumda orijinal kaynak materyal b.pdf
 
Puede crear numerosas vistas personalizadas para usar con to.pdf
Puede crear numerosas vistas personalizadas para usar con to.pdfPuede crear numerosas vistas personalizadas para usar con to.pdf
Puede crear numerosas vistas personalizadas para usar con to.pdf
 
publie elass h 1 pahlte clamsia axcends A pablie clann Main .pdf
publie elass h 1 pahlte clamsia axcends A pablie clann Main .pdfpublie elass h 1 pahlte clamsia axcends A pablie clann Main .pdf
publie elass h 1 pahlte clamsia axcends A pablie clann Main .pdf
 
Puede una empresa ser buena en responsabilidad social corpo.pdf
Puede una empresa ser buena en responsabilidad social corpo.pdfPuede una empresa ser buena en responsabilidad social corpo.pdf
Puede una empresa ser buena en responsabilidad social corpo.pdf
 
public class Monster protected String clanAffiliation pro.pdf
public class Monster  protected String clanAffiliation pro.pdfpublic class Monster  protected String clanAffiliation pro.pdf
public class Monster protected String clanAffiliation pro.pdf
 
Provide three evidences with scholar reference that support.pdf
Provide three evidences with scholar  reference that support.pdfProvide three evidences with scholar  reference that support.pdf
Provide three evidences with scholar reference that support.pdf
 
Provincial Government The name of the representative of the .pdf
Provincial Government The name of the representative of the .pdfProvincial Government The name of the representative of the .pdf
Provincial Government The name of the representative of the .pdf
 
Prpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdf
Prpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdfPrpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdf
Prpugh shicti the bloset fides 1 rightventikiele+3 Fxet.pdf
 
Provide three evidences with reliable reference that suppor.pdf
Provide three evidences with reliable  reference that suppor.pdfProvide three evidences with reliable  reference that suppor.pdf
Provide three evidences with reliable reference that suppor.pdf
 
Provide the Independent variables Dependent variables a.pdf
Provide the Independent variables Dependent variables a.pdfProvide the Independent variables Dependent variables a.pdf
Provide the Independent variables Dependent variables a.pdf
 
Provide your example of a firm or a small business from the .pdf
Provide your example of a firm or a small business from the .pdfProvide your example of a firm or a small business from the .pdf
Provide your example of a firm or a small business from the .pdf
 
Provide the steps for the following In order to install sof.pdf
Provide the steps for the following In order to install sof.pdfProvide the steps for the following In order to install sof.pdf
Provide the steps for the following In order to install sof.pdf
 
Provide land use land cover images and photos using shape.pdf
Provide land use land cover images and photos  using shape.pdfProvide land use land cover images and photos  using shape.pdf
Provide land use land cover images and photos using shape.pdf
 
Provide SQL that creates two database tables Employee and D.pdf
Provide SQL that creates two database tables Employee and D.pdfProvide SQL that creates two database tables Employee and D.pdf
Provide SQL that creates two database tables Employee and D.pdf
 

Recently uploaded

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Programming Assignment 3 CSCE 3530 Introduction to Comput.pdf

  • 1. Programming Assignment #3 CSCE 3530 - Introduction to Computer Networks Spring 2023 100 Points Due: 03/29/2023, 11:55 PM Instructions: Compile the C programs in one of the Cell (cell01 - cell06) servers and make sure it's working. Comment your code. Create a Makefile to compile the source code and to clean the executable. Create a readme file that describes how to compile, execute, and test the code. Create an assignment folder with folder name as euid_PA3 (example: xyz0202_PA3) and add the source file, Makefile, and the readme file to the folder. Please create a zip archive of your assignment folder and upload the zip file to Canvas. Not following the above instructions could result in not accepting your programming assignment. Late submissions are not allowed. Objective: Create a web cache that can cache up to six recent webpages and checks if the pages are up to date. Requirements: 1. Create a C-based client using TCP sockets 2. The client should run on any Cell (cell01 - cell06) machine 3. The client should be able to accept and service http requests 4. The client should be able to cache up to six recent requested webpages, if available 5. The client should check if an updated webpage is available using If-Modified-Since header and replace the old webpage with new webpage in the cache if a updated webpage is available. Procedure: 1. Create a C-based client using TCP sockets 2. The client should run on any Cell (cell01 - cell06) machine and the created client should be able to accept a HTTP website URL using the below format / wcolient URL: Url> Port: 2023 Robin Polfathuparamoid Page 1 of 5where wcclient is the client executable, uri is the requested hostname and port_number is the port number that the web server is listening 3. Once the client gets an URL input from the user, it checks the cache for the requested page. If the page is not found in the cache, proceed to the below steps a. The client makes a connection to the requested URL using the connect system call. The connect system call needs the IP address of the input URL. Use the gethostbyname system call to find the IP address of the input URL b. Once the connection is made, a GET request is made to the web server by client program. Figure 1 shows the overall architecture c. A sample GET request is shown below to request the landing page from google website GET / HTTP/2.1 /rn Host: ww. google.com ln Connection: Closelrln rn d. The above GET request lines are packed as a single string and written to the webserver by client using wri te or send system call e. The client sleeps for a second and then reads (read or recv system call) the incoming stream of data (response) and stores the received data in a buffer. The client then checks for the HTTP response status code in the received response f. If the HTTP response status code is 200 , the retumed web page from the web server is cached (stored as a file). Verify manually to see if the returned page is same as the browser returned page g. The client stores the webpage in a file and assigns a filename based on the time of visit (available in the response header). The filename format is YYYYMMDDhhmmss. Where YYY is the year, MM is the month, DD is the day, hh is the hour in 24-hour format, mm is the minutes, and ss is the seconds when the website was visited h. A list file (list.txt) is created which stores the URL of the webpage and the associated cached web page filename i. The list file stores six recent URLs. The cached websites that are not listed in the list file should be deleted from the cache j. Once the returned web page is cached, the client waits for the next URL input from the user k. If the HTTP response status code is not 200, do not cache the web page instead print the HTTP response status code4. When the user requests a webpage that is in the list.txt file (cache) the client simply prints that the page is found in cache along with the filename and proceeds to the below steps a. The client will ask the user to check if the page was
  • 2. modified. If the user responds with a 'Yes', the user inputs the date and time to check if the page was modified since the input date and time b. Do Step 3a for the connection and once the connection is made, a GET request along with If-Modified-Since header is sent to the web server to check if the page is modified since the input date and time c. A sample GET request with If- Modified-Since header is shown below to request the updated page from example.com website GET/HTTP/1.1In Host: ww. example.com r If-Modified-Since: Thu, 16 Oct 201907:18:26 GMT rn Connection: Clogelr lnrn d. If the HTTP response status code is 200 , the returned web page from the web server is cached (stored as a new file with filename based on the time of visit). The old, cached file is deleted. The list file is updated accordingly with necessary changes e. If the HTTP response status code is 304 , do not cache the web page instead print the HTTP response status code f. If the user responds with a 'No' to check if the page was modified, then the client proceeds to ask the user for the next URL 5. The client program should exit or end execution when a quit expression is given as an input 6. Test web caching by accessing multiple websites. Most websites are not http websites so only select http websites using this website 7. Most websites do not support If-Modified-Since header, so use this website to check if a http website supports If- Modified-Since header 8. A sample list.txt is available on Canvas for reference. Deliverables: 1. Commented client C code 2. A Makefile to compile (make) the source code and to clean (make clean) the executable 3. A readme file that describes how to compile, execute, and test the code. 4. Create an assignment folder with folder name as euid_PA3 (example: xyz0202_PA2) and add the source file, Makefile, and the readme file to the folder. 92023 Rotin Pottathimarambil Page 3 of 5Please create a zip archive of your assignment folder and upload the zip file to Canvas on or before due date. Client-side input/output: ./weclient URL: www google.com Port: 80 Response: 200 Action: Page cached as filename - 20230308101001 URL: www. dmoz.org Port: 80 Response: 400 Action: Not cached URL: ww. example.com Port: 80 Response: 200 Action: Page cached as filename - 20230308101020 URL: 1cio.us Port: 80 Response: 200 Action: Page cached as filename - 20230308101044 URL: wWW. example.com Port: 80 Response: 200 Action: Page found in cache, filename - 20230308101020 Check if modified: Yes Date: Thu, 16 Oct 2019 07:18:26 GMT Response: 200 Action: Updated web page cached as filename - 20230308101110, deleted old page with filename - 20230308101020 URL: Ww. example.com Port: 80 Response: 200 Action: Page found in cache, filename - 20230308101110 Check if modified: Yes Date: Thu, 18 Oct 201907:18:26 GMT Response: 304 Action: Not cached URL: www, example,com Port: 80 Response: 200 Action: Page found in cache, filename - 20230308111110 Check if modified: No URL: quit cya!Figure 1. Overall Architecture.