To develop a simple webserver to serve html pages and display the list of protocols in TCP/IP Protocol Suite.
HTML content creation.
Design of webserver workflow.
Implementation using Python code.
Import the necessary modules.
Define a custom request handler.
Start an HTTP server on a specific port.
Run the Python script to serve web pages.
Serve the HTML pages.
Start the server script and check for errors.
Open a browser and navigate to http://127.0.0.1:8000 (or the assigned port).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Network Protocols Table</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 30px;
background-color: #f4f4f4;
}
h2 {
text-align: center;
color: #333;
}
table {
width: 100%;
border-collapse: collapse;
background-color: white;
}
th, td {
border: 1px solid #ccc;
padding: 12px;
text-align: left;
}
th {
background-color: #007bff;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #dbeafe;
}
</style>
</head>
<body>
<h2>List of Network Protocols</h2>
<table>
<tr>
<th>S.No</th>
<th>Protocol Name</th>
<th>Port Number</th>
<th>Purpose</th>
</tr>
<tr>
<td>1</td>
<td>HTTP</td>
<td>80</td>
<td>Transfers web pages</td>
</tr>
<tr>
<td>2</td>
<td>HTTPS</td>
<td>443</td>
<td>Secure web communication</td>
</tr>
<tr>
<td>3</td>
<td>FTP</td>
<td>20, 21</td>
<td>Transfers files</td>
</tr>
<tr>
<td>4</td>
<td>SSH</td>
<td>22</td>
<td>Secure remote login</td>
</tr>
<tr>
<td>5</td>
<td>Telnet</td>
<td>23</td>
<td>Remote login without encryption</td>
</tr>
<tr>
<td>6</td>
<td>SMTP</td>
<td>25</td>
<td>Sends emails</td>
</tr>
<tr>
<td>7</td>
<td>DNS</td>
<td>53</td>
<td>Translates domain names into IP addresses</td>
</tr>
<tr>
<td>8</td>
<td>DHCP</td>
<td>67, 68</td>
<td>Automatically assigns IP addresses</td>
</tr>
<tr>
<td>9</td>
<td>POP3</td>
<td>110</td>
<td>Retrieves emails</td>
</tr>
<tr>
<td>10</td>
<td>IMAP</td>
<td>143</td>
<td>Manages emails on a mail server</td>
</tr>
<tr>
<td>11</td>
<td>TCP</td>
<td>—</td>
<td>Provides reliable data transmission</td>
</tr>
<tr>
<td>12</td>
<td>UDP</td>
<td>—</td>
<td>Provides connectionless data transmission</td>
</tr>
</table>
</body>
</html>
The program for implementing simple webserver is executed successfully.
.png)