Chapter 1 Fundamentals Networking Introduction PDF

Summary

This document provides an introduction to networking fundamentals, including socket addresses, IP addresses, ports, and protocols like TCP and HTTP. Key concepts such as client-server models and file transfer protocols (FTP) are explained.

Full Transcript

Chapter 1 Fundamentals Introduction 1.1.Introduction Networking Fundamentals (Sockets, IP, TCP, HTTP) A socket address is the combination of an IP address and a port into a single identity, like telephone connection is the combination of a phone number and a particular extension. Internet sockets...

Chapter 1 Fundamentals Introduction 1.1.Introduction Networking Fundamentals (Sockets, IP, TCP, HTTP) A socket address is the combination of an IP address and a port into a single identity, like telephone connection is the combination of a phone number and a particular extension. Internet sockets constitute a mechanism for delivering incoming data packets to the appropriate application process or thread, based on a combination of local and remote IP addresses and port numbers. The term Internet sockets is also used as a name for an application programming interface (API) for the TCP/IP protocol stack, in computer networking, an Internet socket or network socket is an endpoint of a bidirectional inter_ process communication flow across an Internet Protocol-based computer network, such as the Internet. Each socket is mapped by the operating system to a communicating application process or thread. An Internet socket is characterized by a unique combination of the following:  Local socket address: Local IP address and port number  Remote socket address: Only for established TCP sockets. As discussed in the Client- Server section below, this is necessary since a TCP server may serve several clients concurrently. The server creates one socket for each client, and these sockets share the same local socket address: TCP (Transmission Control Protocol) sockets and UDP (User Datagram Protocol) sockets. SOCKET STATES AND THE CLIENT-SERVER MODEL  Computer processes that provide application services are called servers, and create sockets on startup that are in listening state.  These sockets are waiting for initiatives from client programs. For a listening TCP socket, the remote address presented by netstat may be denoted 0.0.0.0 and the remote port number 0.  A TCP server may serve several clients concurrently, by creating a child process for each client and establishing a TCP connection between the child process and the client.  Unique dedicated sockets are created for each connection. 1  These are in established state, when a socket-to-socket virtual connection or virtual circuit (VC), also known as a TCP session, is established with the remote socket, providing a duplex byte stream. File Transfer Protocol (FTP): is a client-server protocol, with which a client requests a file and the server supplies it. FTP runs over TCP/IP -- a suite of communications protocols -- and requires a command channel and a data channel to communicate and exchange files, respectively. Clients request files through the command channel and receive access to download, edit and copy the file, among other actions, through the data channel. FTP is a common network protocol for more private file sharing, such as in banking. Hypertext Transfer Protocol (HTTP): is an application-level protocol that enables the transfer of hypertext, such as HTML documents, over the internet. It operates on top of TCP and follows the client-server model. HTTP is widely used for web browsing, web services, and other applications involving the retrieval and transmission of resources between clients and servers.  Short for Hypertext Transfer Protocol, the underlying protocol used by the World Wide Web.  HTTP functions as a request-response protocol in the client server computing model. A web browser, for example, may be the client and an application running on a computer hosting a web site may be the server For example, when you enter a URL in your browser, this actually sends an HTTP command to the Web server directing it to fetch and transmit the requested Web page.  The other main standard that controls how the World Wide Web works is HTML, which covers how Web pages are formatted and displayed.  HTTP is a stateless protocol. A stateless protocol does not require the HTTP server to retain information or status about each user for the duration of multiple requests.  This is the main reason that it is difficult to implement Web sites that react intelligently to user input.  This shortcoming of HTTP is being addressed in a number of new technologies, including ActiveX, Java, JavaScript and cookies 2 Another form of HTTP is HTTPS, which stands for HTTP over Secure Sockets Layer or HTTP Secure. HTTPS can encrypt a user's HTTP requests and webpages. This provides more security to users and can prevent common cybersecurity threats, such as man-in-the-middle attacks. What is Protocol? Protocol: In information technology, a protocol is the special set of rules that end points in a telecommunication connection use when they communicate. Protocols specify interactions between the communicating entities. e.g., TCP, UDP, IP etc Internet Protocol (IP): functions similarly to a postal service. When users send and receive data from their device, the data gets spliced into packets. Packets are like letters with two IP addresses: one for the sender and one for the recipient. 1. Internet Protocol (IP) is the method or protocol by which data is sent from one computer to another on the Internet. 2. Each computer on the Internet has at least one IP address that uniquely identifies it from all other computers on the Internet. 3. When you send or receive data the message gets divided into little chunks called packets 4. Each of these packets contains both the sender's Internet address and the receiver's address. 5. Any packet is sent first to a gateway computer that understands a small part of the Internet. 6. The gateway computer reads the destination address and forwards the packet to an adjacent gateway that in turn reads the destination address and so forth across the Internet until one gateway recognizes the packet as belonging to a computer within its immediate neighborhood or domain. 7. That gateway then forwards the packet directly to the computer whose address is specified. IP addresses are either IPv4 (32-bit address) or IPv6 (128-bit address) format. After the packet leaves the sender, it goes to a gateway, like a post office, that directs it in the proper direction. Packets continue to travel through gateways until they reach their destinations. IP is commonly paired with TCP to form TCP/IP, the overall internet protocol suite. Together, IP sends packets to their destinations, and TCP arranges the packets in the correct order, as IP sometimes sends packets out of order to ensure the packets travel the fastest ways. 3 1.2.Client-side Components :( HTML, XML, browsers, applets, HTML forms, JavaScript, VBScript.) Client-side components play a significant role in web development and enhancing the user experience HTML is the standard markup language used for creating the structure and presenting content on web pages to transfer in internet (read our last class in Internet programming) XML is a versatile markup language used for storing and transporting structured data. Unlike HTML, XML allows users to define their own custom tags and document structures. It is commonly used for data exchange between different systems and platforms. Browsers are software applications that retrieve, interpret, and display web resources, including HTML, XML, CSS, and JavaScript. Popular web browsers include Chrome, Firefox, Safari, and Edge. Browsers render HTML, apply CSS styles, execute JavaScript, and provide a user Applets are small software programs written in languages like Java that are embedded within web pages. They are executed on the client-side by Java-enabled web browsers. HTML forms allow users to input data and submit it to a server for processing. They provide a way to collect user information, such as text inputs, checkboxes, radio buttons, dropdown menus, and submit buttons. Form data is typically sent to a server using HTTP methods like GET or POST. JavaScript is a popular scripting language used for client-side web development. It enables dynamic and interactive features on web pages. JavaScript can manipulate HTML elements, handle user events, perform calculations, make AJAX requests to the server, and much more. VBScript (Visual Basic Scripting Edition) is a scripting language developed by Microsoft. It is similar to JavaScript and allows for client-side scripting in web pages viewed in Internet Explorer 1.3. Server-side Components: (Web servers, servlets, CGI, JSP, ASP, PHP, application servers.) 4 Server-side components are integral to the processing and delivery of web applications.  Server-side components provide the API for user applications to build their user interface.  Many applications do not ever need to bother with the client-side implementation of the standard components  A server-side component has two basic tasks: it has to be able to serialize its state variables to the corresponding client-side component, and deserialize any user input received from the client.  Many of these tasks are taken care of by the component framework. WEB SERVER A Web server is a program that, using the client/server model and the World Wide Web's Hypertext Transfer Protocol (HTTP), serves the files that form Web pages to Web users.  Every computer on the Internet that contains a Web site must have a Web server program.  Two leading Web servers are 1. Apache, the most widely-installed Web server, and 2. Microsoft's Internet Information Server ( IIS ). In addition to them 3. Tomcat Other Web servers include Novell's Web Server for users of its NetWare operating system and IBM's family of Lotus Domino servers, primarily for IBM's OS/390 and AS/400 customers. Web servers are software applications that handle incoming requests from clients (web browsers) and deliver web content in response. They manage the transmission of data over the HTTP protocol. ADVANTAGES OF WEB SERVER Here are some advantages of using a web server within your development environment:  Your local website behaves more like the live one. For example, you can configure directory security; test your custom error pages etc before committing them to the production environment. You can use server-side scripting languages such as PHP and ColdFusion. 5  Allows you to standardize your coding.  Knowledge. The knowledge you gain from using your own web server will help you understand how it works in the live environment. This will most certainly help you when you need to communicate with your hosting provider - you'll be able to use terminology that makes it easier for them to understand your request/issue. HOW WEB SERVERS WORK CGI (COMMON GATEWAY INTERFACE) Common Gateway Interface (CGI) is a standard method used to generate dynamic content on web pages and web applications. CGI, when implemented on a web server provides an interface between the web server and programs that generate the web content. CGI is a standard protocol for interfacing external programs with web servers. It enables web servers to execute scripts or programs in response to client requests. CGI scripts can be written in various languages like Perl, Python, C++, and more. These programs are known as CGI scripts or simply CGIs; they are usually written in scripting language.  Is a specification for transferring information between a World Wide Web server and a CGI program?  A CGI program is any program designed to accept and return data that conforms to the CGI specification.  The program could be written in any programming language 6  CGI programs are the most common way for Web servers to interact dynamically with users. Many HTML pages that contain forms, use a CGI program to process the form's data once it's submitted Java servlet A Java servlet is a Java programming language program that extends the capabilities of a server. Although servlets can respond to any types of requests, they most commonly implement applications hosted on Web servers. Such Web servlets are the Java counterpart to other dynamic Web content technologies such as PHP and ASP.NET A Servlet is an object that receives a request and generates a response based on that request. To deploy and run a servlet, a web container must be used. A web container (also known as a servlet container) is essentially the component of a web server that interacts with the servlets. The web container is responsible for managing the lifecycle of servlets, mapping a URL to a particular servlet and ensuring that the URL requester has the correct access rights The basic Servlet package defines Java objects to represent servlet requests and responses, as well as objects to reflect the servlet's configuration parameters and execution environment Servlets are Java-based server-side components that run on a web server and handle HTTP requests and responses. Life cycle of a servlet Three methods are central to the life cycle of a servlet. 1. init(), 2. service(), 3. destroy (). They are implemented by every servlet and are invoked at specific times by the server JSP (JavaServer Pages): JSP is a technology that allows the creation of dynamic web pages using Java. It combines HTML or XML templates with embedded Java code. JavaServer Pages (JSP) is a server-side programming technology that enables the creation of dynamic, platform-independent method for building Web-based applications. JSP have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. A JSP page consists of HTML tags and JSP tags. The jsp pages are easier to maintain than servlet because we 7 can separate designing and development. It provides some additional features such as Expression Language, Custom Tag etc. ASP is a server-side technology developed by Microsoft. It enables the creation of dynamic web pages using scripts written in languages like VBScript or JScript. PHP is a widely used server-side scripting language specifically designed for web development. It can be embedded within HTML code or used as a standalone script. PHP scripts are executed on the server to generate dynamic web content. It is a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP APPLICATION SERVER  An application server is a server program in a computer in a distributed network that provides the business logic for an application program.  The application server is frequently viewed as part of a three-tier application, consisting of a graphical user interface (GUI) server, an application (business logic) server, and a database and transaction server.  More descriptively, it can be viewed as dividing an application into: 1. A first-tier, front-end, Web browser-based graphical user interface, usually at a personal computer or workstation 2. A middle-tier business logic application or set of applications, possibly on a local area network or intranet server 3. A third-tier, back-end, database and transaction server, sometimes on a mainframe or large server Older, legacy application databases and transaction management applications are part of the back end or third tier. The application server is the middleman between browser-based front-ends and backend databases and legacy systems Application servers provide a runtime environment for hosting and executing web applications. They offer additional services and features beyond what web servers provide, such as connection pooling, transaction management, security, scalability, and more. Examples of application servers include Apache Tomcat, JBoss, IBM WebSphere, and Microsoft IIS. 8 1.4. Data-base Components: ( SQL, JDBC, database servers) Database components are essential for storing, managing, and manipulating structured data. SQL is a standardized programming language used for managing relational databases. It provides a set of commands for creating, modifying, and querying databases. SQL allows users to define database schemas, insert, update, and delete data, and perform complex queries to retrieve information. JDBC is a Java API (Application Programming Interface) that provides a standard way for Java applications to interact with databases. It allows developers to establish database connections, execute SQL statements, and retrieve and manipulate data. JDBC provides a bridge between Java applications and database systems, enabling seamless integration and data access. Database servers are software applications that manage databases and handle client requests. They provide a centralized storage system for data and offer features like data integrity, security, concurrency control, and backup and recovery mechanisms. Popular database servers include MySQL, Oracle Database, Microsoft SQL Server, PostgreSQL, and MongoDB. 9

Use Quizgecko on...
Browser
Browser