π Lecture 58 β Networking and the Internet: Internet Multimedia Streaming
π Overview: This lecture explores the challenges and solutions for streaming multimedia content over the Internet. It covers the fundamental differences between stored and live streaming, the role of compression and buffering, and key protocols like RTSP and RTP. Understanding these concepts is critical for appreciating how services like Netflix and YouTube deliver seamless video experiences.
ποΈ Topics Covered
The lecture begins by defining multimedia and the digital representation of audio and video signals. It then examines the streaming stored audio/video process, highlighting the distinction between simple downloading and streaming. Key techniques such as compression, buffering, and the use of UDP versus TCP are discussed, alongside Real-Time Streaming Protocol (RTSP) and Real-Time Transport Protocol (RTP). Finally, it covers streaming live audio/video and interactive audio/video (e.g., VoIP), along with the challenges of real-time interactive communication.
π Lecture Summary
Multimedia
Multimedia refers to data that includes audio, video, and graphics. The lecture focuses on streaming these media types over the Internet. The fundamental challenge is that the Internet is a best-effort delivery network, offering no guarantee for timing, bandwidth, or packet lossβall of which are crucial for smooth playback.
π Definition β Multimedia: Data that involves more than one medium, specifically audio and video. π Definition β Streaming: A technique for transferring data so that it can be processed as a steady and continuous stream, allowing playback to begin before the entire file has been downloaded. π Definition β Best-effort delivery: A network service model with no guarantees regarding delay, jitter (delay variation), or packet loss.
Digital Audio/Video
To transmit multimedia over the Internet, analog signals (audio and video) must be converted to digital form.
π Definition β Sampling: Measuring the amplitude of a signal at discrete time intervals (e.g., 8000 samples/sec for telephone voice). π Definition β Quantization: Assigning a digital value to each sample. π Definition β Pulse Code Modulation (PCM): A standard method for digitizing analog signals by sampling and quantizing. π Formula: Bit rate = Sampling rate Γ Bits per sample β This gives the number of bits needed per second to represent the digitized signal. π Example: For a telephone voice signal: Sampling rate = 8000 samples/sec, Bits per sample = 8. Therefore, Bit rate = 8000 Γ 8 = 64,000 bps (64 kbps).
Streaming Stored Audio/Video
This section discusses streaming pre-recorded files (like a movie on Netflix). The key idea is to avoid downloading the entire file before playback starts.
- Approach 1: Download-and-play: The entire file is downloaded, creating a long delay. Not suitable for real-time or live viewing.
- Approach 2: Using a Web Server with a Metafile: A small metafile (containing the URL of the media file) is sent to the browser, which launches a media player (plug-in). The player then downloads the file from the server, but it still uses HTTP over TCP, introducing delays from congestion control (e.g., slow start) and retransmission.
- Approach 3: Using a Media Server: A specialized media server (e.g., using RTSP) is used. The client and server communicate, and the server sends the media stream, often using UDP to avoid TCP overhead, but this risks packet loss.
π Definition β Metafile: A small file containing information (like the URL) about the actual media file.
Using UDP/TCP
- Using UDP: The media server sends the stream via UDP. This is fast and avoids TCP's congestion control, but UDP does not guarantee delivery. The application must handle timestamps and sequence numbers to reorder packets and compensate for jitter.
- Using TCP: More reliable but can cause delays due to retransmission and congestion control. Many modern streaming services (e.g., Netflix) use TCP because firewalls often block UDP, and TCP's reliability ensures no glitches.
π‘ Why this matters: The choice between TCP and UDP is a fundamental trade-off in streaming: speed vs. reliability.
Real-Time Streaming Protocol (RTSP)
RTSP is a control protocol used to establish and control media sessions. It acts like a "remote control" for the media player, allowing commands like PLAY, PAUSE, and STOP. RTSP does not typically deliver the media stream itself; it uses other protocols (like RTP) for data delivery.
π Definition β RTSP (Real-Time Streaming Protocol): An application-level protocol used to control the delivery of streaming media, acting as a "network remote control."
Real-Time Transport Protocol (RTP)
RTP is the standard protocol for delivering audio and video over IP networks. It runs on top of UDP. RTP packets contain:
- Sequence number: To detect packet loss and reorder packets.
- Timestamp: To allow the receiver to play back the media at the correct speed and synchronize multiple streams.
- Payload type: To identify the encoding format (e.g., MPEG, H.264).
π Definition β RTP (Real-Time Transport Protocol): A protocol that provides end-to-end delivery services for data with real-time characteristics, such as audio and video.
Real-Time Transport Control Protocol (RTCP)
RTCP is a companion protocol to RTP. It provides feedback on the quality of the transmission (e.g., packet loss, jitter). This feedback can be used by the sender to adjust the transmission rate or encoding.
π Definition β RTCP (Real-Time Transport Control Protocol): A protocol that monitors the quality of an RTP session by providing feedback on packet loss and jitter.
Voice Over IP (VoIP) β SIP
This section introduces Session Initiation Protocol (SIP), used to establish, modify, and terminate multimedia sessions (like phone calls over IP). SIP handles user location, session setup, and session management.
π Definition β SIP (Session Initiation Protocol): A signaling protocol used for initiating, maintaining, and terminating real-time sessions that include voice, video, and messaging applications.
Streaming Live Audio/Video
This covers streaming events as they happen (e.g., a live sports game). The media is not stored; it is delivered in real-time. The challenge is that events can have unpredictable durations. Techniques used are similar to stored streaming but with no ability to pause or rewind the live feed.
Interactive Audio/Video
This covers real-time, two-way communication (e.g., video conferencing, VoIP). The key challenge is very low latency (typically under 150-200 ms) to avoid noticeable delays. Jitter is a major problem, and jitter buffers are used to smooth out delay variations.
π Definition β Jitter: The variation in packet arrival time at the receiver.
β Key Takeaways
A student must remember that multimedia streaming over the Internet is fundamentally challenged by the best-effort nature of IP networks, requiring careful design to manage delay, jitter, and packet loss. The core difference between stored and live streaming is the ability to pre-process and buffer the content. RTSP acts as a control protocol, while RTP carries the actual media data with timing and sequencing. The trade-off between using UDP (fast, less reliable) and TCP (reliable, but slower) is a critical design decision for any streaming application. Finally, real-time interactive applications like VoIP demand the lowest possible latency, making jitter management essential.
π§ Quick Revision Questions
- What is the difference between a "simple download" and "streaming"?
- What are the three main challenges the Internet's best-effort model poses for multimedia?
- Name the two main approaches (protocols) for delivering the actual media stream, and give one advantage of each.
- What is the role of the timestamp in an RTP packet?
- Why is jitter a more critical problem for interactive audio/video than for streaming stored video?
π Lecture 59 β Networking and the Internet: Web implementations
π Overview: This lecture explores the practical implementations of web technologies, focusing on how networks and the internet function at the application layer. It matters because understanding web implementations is essential for building, deploying, and troubleshooting modern web applications.
ποΈ Topics Covered
The lecture covers web server architectures, client-server models, HTTP protocol details, web caching mechanisms, content delivery networks (CDNs), and web security implementations including HTTPS and SSL/TLS. It also discusses scalable web architectures and performance optimization techniques.
π Lecture Summary
Web Server Architectures
The lecture begins by describing the different web server architectures. A web server is software that handles HTTP requests from clients and serves web content. The most common architectures include single-threaded, multi-threaded, and event-driven models. Single-threaded servers process one request at a time, which is simple but inefficient. Multi-threaded servers create a new thread for each request, allowing concurrent processing but consuming more system resources. Event-driven servers use a single thread with asynchronous I/O, achieving high concurrency with low overhead.
π Definition β Web Server: software that accepts HTTP requests from clients and returns HTTP responses, typically containing web pages or other web resources. π Formula: throughput β concurrent connections Γ request rate β meaning the number of requests a server can handle per second depends on how many connections it can maintain simultaneously. π Example: An Apache HTTP server configured with a multi-processing module (MPM) can handle 150 concurrent connections. If each request takes 200ms to process, the maximum throughput is 150 / 0.2 = 750 requests per second.
Client-Server Model and HTTP Protocol
The client-server model underpins all web communications. The client (usually a web browser) initiates a request, and the server responds. The HTTP protocol defines the format of these messages. HTTP is a stateless protocol, meaning each request is independent and the server does not retain session information between requests. HTTP messages consist of a request line (method, URL, version), headers (metadata), and an optional body.
Key HTTP methods include GET (retrieve data), POST (submit data), PUT (update data), and DELETE (remove data). The status codes indicate the result: 200 OK (success), 404 Not Found, 500 Internal Server Error, and others.
π‘ Why this matters: The stateless nature of HTTP is the reason why web applications use cookies, sessions, and tokens to maintain user state across requests.
π Definition β HTTP: Hypertext Transfer Protocol, an application-layer protocol for transmitting hypermedia documents, such as HTML.
π Formula: response time = network latency + server processing time β where network latency includes DNS resolution, TCP handshake, and data transfer.
π Example: A browser sends a GET request to https://example.com/index.html. The server responds with a 200 OK status, headers (Content-Type: text/html), and the HTML content. Total time: DNS lookup (50ms) + TCP connection (30ms) + server processing (100ms) + data transfer (20ms) = 200ms.
Web Caching Mechanisms
Web caching improves performance by storing copies of frequently accessed content closer to users. Browser caching stores resources locally on the clientβs machine, using headers like Cache-Control and Expires to determine freshness. Proxy caching involves intermediate servers that cache responses for multiple users. Cache hits occur when the requested content is already in cache, dramatically reducing load time.
Cache invalidation is the process of removing stale content. Strategies include time-based expiration (e.g., cache for 3600 seconds), validation (using ETags or Last-Modified headers to check freshness), and explicit invalidation (purging cache when content changes).
π Definition β Cache Hit: when a requested resource is found in the cache, serving it without contacting the origin server. π Formula: cache hit rate = number of cache hits / total number of requests β higher rates indicate better cache efficiency. π Example: A news website caches the homepage for 5 minutes. If 1000 users request it within those 5 minutes, the first request fetches from the server (cache miss), but the remaining 999 get served from cache (cache hits). Cache hit rate = 999/1000 = 99.9%.
Content Delivery Networks (CDNs)
A Content Delivery Network (CDN) is a geographically distributed network of servers that deliver web content to users based on their location. CDNs reduce latency by serving content from the nearest edge server. Common use cases include delivering static assets (images, CSS, JavaScript), streaming video, and protecting against DDoS attacks.
CDNs work by caching content at edge nodes. When a user requests a resource, the CDN routes the request to the optimal edge server. If the content is not cached, the edge server fetches it from the origin server, caches it, and serves it. CDNs typically use anycast routing to direct traffic to the nearest available node.
π‘ Why this matters: Without CDNs, users far from the origin server would experience significantly slower load times, especially for large files like videos or high-resolution images.
π Definition β Edge Server: a server in a CDN that sits at the network edge, close to end users, to deliver cached content quickly. π Formula: CDN latency = distance to edge server / speed of light + queuing delay + server processing time β typically much smaller than direct access to the origin server. π Example: A user in Tokyo requests a video from a server in New York (latency ~200ms). With a CDN that has an edge server in Tokyo, the latency drops to ~10ms, a 20x improvement.
Web Security Implementations: HTTPS and SSL/TLS
HTTPS (HTTP Secure) encrypts communication between client and server using SSL/TLS (Secure Sockets Layer/Transport Layer Security). This prevents eavesdropping, tampering, and impersonation. The process begins with a TLS handshake where the client and server agree on encryption algorithms and exchange keys.
Certificates issued by Certificate Authorities (CAs) verify the serverβs identity. When a client connects to https://example.com, the server presents its certificate. The client checks that the certificate is valid, issued by a trusted CA, and matches the domain name. Once verified, a symmetric session key is established for secure communication.
Key components include asymmetric encryption (public/private key pairs) for the handshake and symmetric encryption (shared secret keys) for the actual data transfer. SSL/TLS also provides integrity through message authentication codes (MACs).
π Definition β TLS Handshake: the process where client and server authenticate each other and establish encryption parameters before any data is transmitted.
π Formula: encryption overhead β 2x to 10x additional CPU time compared to plain HTTP β but modern hardware reduces this to negligible levels.
π Example: When a browser connects to https://bank.com, the handshake takes approximately 2 round trips (about 100ms). After that, all data including login credentials and account information is encrypted with a 256-bit AES key, making it unreadable to interceptors.
Scalable Web Architectures
Building scalable web systems requires distributing load across multiple servers. Horizontal scaling adds more machines, while vertical scaling upgrades existing hardware. Load balancers distribute incoming requests across a pool of servers, ensuring no single server is overwhelmed.
Common architectures include three-tier architecture (web server, application server, database server) and microservices (small, independent services that communicate over a network). Database sharding splits large databases across multiple servers to improve performance.
Caching at multiple levels (browser, CDN, application, database) reduces load on backend systems. Asynchronous processing with message queues (e.g., RabbitMQ, Kafka) handles background tasks without blocking user requests.
π Definition β Load Balancer: a device or software that distributes incoming network traffic across multiple servers to ensure reliability and performance. π Formula: total capacity = number of servers Γ capacity per server β but with overhead for coordination and load balancing. π Example: An e-commerce site uses a load balancer with 5 application servers. Each server can handle 1000 requests/second. The total theoretical capacity is 5000 requests/second, but due to session management and state synchronization, actual peak is closer to 4000 requests/second.
β Key Takeaways
The lecture emphasizes that web implementation involves multiple layers from server architecture to security. Understanding HTTP as a stateless protocol is fundamental to designing web applications that maintain state through cookies, sessions, or tokens. Caching at the browser, proxy, and CDN levels dramatically improves performance, with cache hit rates being a critical metric. Web security through HTTPS and SSL/TLS is non-negotiable for protecting user data, with the TLS handshake ensuring both encryption and authentication. Finally, scalable architectures require horizontal scaling, load balancing, and asynchronous processing to handle growing traffic efficiently.
π§ Quick Revision Questions
- What is the difference between single-threaded, multi-threaded, and event-driven web server architectures, and which one achieves the highest concurrency with low overhead?
- Why is HTTP considered a stateless protocol, and what mechanisms do web applications commonly use to overcome this limitation?
- How does a CDN reduce latency for users, and what role does an edge server play in this process?
- During a TLS handshake, what two types of encryption are used and for which phases of the connection?
- What is a cache hit rate, and why is it an important metric for web performance optimization?
π Lecture 60 β Module 72
π Overview: This lecture introduces Module 72, focusing on advanced concepts in electrical engineering, specifically the analysis of alternating current (AC) circuits using phasor diagrams and complex impedance. It is critical for understanding how AC systems behave under steady-state conditions, which is foundational for power systems and electronics.
ποΈ Topics Covered
The lecture covers the definition and construction of phasor diagrams for AC circuits, the calculation of complex impedance for resistors, inductors, and capacitors in series and parallel configurations, and the application of Ohm's law in phasor form. It also includes examples of solving for voltage and current in RLC circuits.
π Lecture Summary
Introduction to Phasor Diagrams
A phasor diagram is a graphical representation of the magnitude and phase relationship between sinusoidal voltages and currents in an AC circuit. Phasors rotate counterclockwise at the angular frequency Ο, and their lengths represent the root mean square (RMS) or peak values. The phase angle difference between phasors indicates whether the circuit is inductive (current lags voltage) or capacitive (current leads voltage).
π Definition β Phasor: A complex number representing the amplitude and phase of a sinusoidal function. It is expressed as ( \tilde{V} = V_m \angle \theta ), where ( V_m ) is the peak voltage and ( \theta ) is the phase angle. π Formula: Impedance ( Z = R + jX ) β The total opposition to AC current, where ( R ) is resistance and ( X ) is reactance (inductive ( X_L = \omega L ) or capacitive ( X_C = 1/(\omega C) )). π Example: For a 50 Hz AC source with a 10 Ξ© resistor and a 0.1 H inductor in series, the inductive reactance is ( X_L = 2\pi (50)(0.1) = 31.4 , \Omega ). The total impedance is ( Z = 10 + j31.4 , \Omega ). In phasor form: ( Z = 33.0 \angle 72.3^\circ , \Omega ). The current phasor lags the voltage phasor by 72.3Β°.
π‘ Why this matters: Phasor diagrams simplify the analysis of AC circuits by converting sinusoidal time functions into static vectors, making it easier to compute total voltage, current, and power.
Series RLC Circuit Analysis
In a series RLC circuit, the current is the same through all components, but the voltage across each element differs in phase. The total voltage phasor is the vector sum of the individual voltage phasors. The resonant frequency occurs when ( X_L = X_C ), minimizing impedance and maximizing current.
π Definition β Resonance: The condition in an RLC circuit where inductive reactance equals capacitive reactance, resulting in purely resistive impedance and unity power factor. π Formula: Resonant angular frequency ( \omega_0 = \frac{1}{\sqrt{LC}} ), and resonant frequency ( f_0 = \frac{1}{2\pi \sqrt{LC}} ). Impedance at resonance: ( Z = R ). π Example: An RLC series circuit with ( R = 5 , \Omega ), ( L = 20 , \text{mH} ), and ( C = 100 , \mu\text{F} ). At resonance: ( \omega_0 = 1 / \sqrt{0.02 \cdot 100 \times 10^{-6}} = 707.1 , \text{rad/s} ), and ( f_0 = 707.1 / (2\pi) \approx 112.5 , \text{Hz} ). At this frequency, the circuit behaves as a 5 Ξ© resistor. The current is maximum: ( I = V / R ).
π‘ Why this matters: Resonance is key in tuning circuits for radios and filters, allowing selection of specific frequencies.
Parallel RLC Circuit Analysis
In a parallel RLC circuit, the voltage across all components is the same, but the currents through each branch differ in phase. The total current phasor is the vector sum of the branch currents. The admittance (reciprocal of impedance) simplifies analysis: ( Y = 1/Z = G + jB ), where ( G ) is conductance and ( B ) is susceptance.
π Definition β Admittance: The measure of how easily a circuit allows AC current to flow, defined as ( Y = 1/Z ). Its real part is conductance ( G ) (siemens), and imaginary part is susceptance ( B ) (siemens). π Formula: For a parallel RLC circuit: ( Y = \frac{1}{R} + j\left(\omega C - \frac{1}{\omega L}\right) ). At resonance, ( \omega C = 1/(\omega L) ), so ( Y = 1/R ) and the circuit is purely resistive. π Example: A parallel RLC circuit with ( R = 20 , \Omega ), ( L = 50 , \text{mH} ), ( C = 10 , \mu\text{F} ), at ( f = 200 , \text{Hz} ). Compute ( \omega = 2\pi(200) = 1256.6 , \text{rad/s} ). Then ( \omega C = 1256.6 \cdot 10 \times 10^{-6} = 0.01257 , \text{S} ), and ( 1/(\omega L) = 1/(1256.6 \cdot 0.05) = 0.01592 , \text{S} ). So ( Y = 0.05 + j(0.01257 - 0.01592) = 0.05 - j0.00335 , \text{S} ). The total impedance ( Z = 1/Y = 19.93 + j1.34 , \Omega ).
π‘ Why this matters: Parallel resonance is used in tank circuits for oscillators and band-pass filters.
β Key Takeaways
Students must confidently draw and interpret phasor diagrams for series and parallel RLC circuits, recognize that impedance is a complex quantity combining resistance and reactance, and calculate resonant frequencies and impedance at resonance. Mastering the vector addition of phasors and the use of admittance for parallel circuits is essential for solving AC circuit problems efficiently. The relationship between voltage and current phase angles determines whether a circuit is inductive or capacitive, which directly impacts power factor calculations.
π§ Quick Revision Questions
- Draw the phasor diagram for a series RL circuit with voltage leading current by 45Β°. Label all phasors.
- A series RLC circuit has ( R = 10 , \Omega ), ( L = 0.2 , \text{H} ), ( C = 50 , \mu\text{F} ). Calculate the resonant frequency in Hz.
- Explain the difference between impedance and admittance. When is it more convenient to use admittance?
- For a parallel RLC circuit at resonance, what is the total impedance? Why?
- A 120 V, 60 Hz source is connected to a 20 Ξ© resistor in series with a 100 ΞΌF capacitor. Find the current phasor (magnitude and phase angle).
π Lecture 61 β Module 73
π Overview: This lecture explains how to create functional hyperlinks and embed images in webpages using HTML. It focuses on anchor tags, the href parameter, and image tags, which are fundamental for connecting web resources.
ποΈ Topics Covered
The lecture covers linking text to other documents using anchor tags, how to specify the URL as a hypertext reference, the visual representation of links on a webpage, and how to include an image in a webpage using the image tag and src parameter.
π Lecture Summary
Linked Webpages
A simple webpage may include the text "click here" with the intention that clicking the word here will cause the browser to display another page. To cause the appropriate action, we must link the word here to another document.
When the word here is clicked, we want the browser to retrieve and display the page at the URL http://crafty.com/demo.html. To do so, we must first surround the word here in the source version of the page with the tags <a> and </a>, which are called anchor tags. Inside the opening anchor tag we insert the parameter href = http://crafty.com/demo.html indicating that the hypertext reference (href) associated with the tag is the URL following the equal sign.
Having added the anchor tags, the webpage will now appear on a computer screen as shown in the lecture. Note that this is identical to the original webpage except that the word here is highlighted by color indicating that it is a link to another webpage. Clicking on such highlighted terms will cause the browser to retrieve and display the associated webpage. Thus, it is by means of anchor tags that webpages are linked to each other.
π Definition β Anchor tags (<a> and </a>): Tags used to create a hyperlink to another document or webpage.
π Formula: <a href="URL">link text</a> β The text between the tags becomes a clickable link that navigates to the specified URL.
π Example: For the URL http://crafty.com/demo.html, the HTML is: <a href = "http://crafty.com/demo.html">here</a>. This makes the word "here" a clickable link that retrieves and displays the page at that URL.
Including an Image
Finally, we should indicate how an image could be included in our simple webpage. For this purpose, let us suppose that a JPEG encoding of the image we want to include is stored as the file named OurPic.jpg in the directory Images at Images.com and is available via the webserver at that location.
Under these conditions, we can tell a browser to display the image at the top of the webpage by inserting the image tag <img src = "http://Images.com/Images/OurPic.jpg"> immediately after the <body> tag in the HTML source document. This tells the browser that the image named OurPic.jpg should be displayed at the beginning of the document. The term src is short for "source," meaning that the information following the equal sign indicates the location of the image file.
π‘ Why this matters: The image tag allows webpages to visually display graphics and photographs, making pages more engaging and informative.
π Definition β Image tag (<img>): A self-closing tag used to embed an image in an HTML document.
π Formula: <img src = "URL"> β The browser fetches and displays the image file located at the specified URL.
π Example: To display OurPic.jpg from the directory Images at Images.com, the HTML is: <img src = "http://Images.com/Images/OurPic.jpg">. This is placed after the <body> tag to show the image at the top of the page.
β Key Takeaways
Anchor tags and image tags are essential HTML elements for linking webpages and embedding visual content. The anchor tag uses the href parameter to specify the destination URL, while the image tag uses the src parameter to indicate the image file's location. Both tags require precise URL syntax to function correctly. The highlighted word created by anchor tags provides a visual cue that a link is active, and the image tag displays content immediately at the point of insertion. Mastery of these tags is foundational for building interactive and visually rich webpages.
π§ Quick Revision Questions
- What are the names of the tags used to create a hyperlink from text to another webpage?
- What does the
hrefparameter specify inside an anchor tag? - How does a browser visually indicate that a word is a clickable link on a webpage?
- Which tag is used to embed an image in an HTML document?
- What does the
srcparameter specify inside an image tag, and where should the tag be placed to show an image at the top of a page?
π Lecture 62 β Networking and the Internet: More on HTML
π Overview: This lecture explores the basic operation of HTML image tags and how they interact with web servers. It also introduces the W3Schools online resource as a comprehensive reference for learning and testing HTML tags through live code examples.
ποΈ Topics Covered
The lecture discusses the <img> tag used to display images on webpages, showing how the browser requests an image from a server when it encounters the tag. It also explains how the position of the tag determines where the image appears on the page. Finally, it introduces W3Schools as a learning tool for all HTML tags, with a demonstration of the <b> tag and the βTry it Yourselfβ feature.
π Lecture Summary
More on HTML: The Image Tag and Tag Positioning
The lecture explains that the <img> tag is used to display images on a webpage. When the browser encounters this tag, it sends a message to an HTTP server requesting the specified image file. For example, if the tag contains a source attribute pointing to Images.com and a file called OurPic.jpg, the browser requests and displays that image. If the <img> tag is placed at the end of the document, just before the </body> tag, the image will appear at the bottom of the webpage. More advanced techniques for positioning images exist but are not covered in this lecture.
π Definition β <img> tag: An HTML tag used to embed an image in a webpage, typically with a src attribute specifying the image file's location.
π Formula: <img src="URL_of_image"> β The browser requests the image from the given URL and displays it at the tag's position in the document.
π Example: If an <img src="http://Images.com/OurPic.jpg"> tag is placed just before </body>, the image will appear at the bottom of the webpage.
W3Schools: A Resource for HTML Tags
The lecture introduces W3Schools (https://www.w3schools.com/tags/default.asp) as a resource for information about all HTML tags and their usage. For instance, clicking on the <b> tag on the left panel displays a screen similar to what is shown in Figure 70. If the user clicks the green βTry it Yourselfβ button, they see details such as code demonstrated on the left side and the output shown on the right side (Figure 71). This allows users to practice and understand how each tag works.
π Definition β W3Schools: An online learning platform that provides documentation and interactive examples for HTML and other web technologies.
π Formula: link_to_W3Schools_tag_page + "Try it Yourself" button β A live code editor and preview window.
π Example: Clicking the <b> tag link on W3Schools shows a page (Figure 70). Clicking βTry it Yourselfβ opens a window (Figure 71) with code on the left and output on the right.
π‘ Why this matters: W3Schools is a practical tool for learning and testing HTML immediately, making it easier for beginners to understand how tags function.
β Key Takeaways
Students must remember that the <img> tag is used to display images and that its position in the HTML document determines where the image appears on the webpage. The browser actively requests the image from the specified server when processing the tag. W3Schools is a valuable online resource for learning all HTML tags, offering live code examples where users can see both the code and its output side-by-side. The βTry it Yourselfβ feature provides hands-on practice for each tag. Understanding these basics is essential for building simple webpages.
π§ Quick Revision Questions
- What does the
<img>tag do in an HTML document? - What happens when a browser encounters an
<img>tag with a source attribute pointing to a specific URL? - If an
<img>tag is placed just before the</body>tag, where will the image appear on the webpage? - What is the web address for the W3Schools HTML tags reference page?
- What feature does W3Schools provide that allows users to see code and its output simultaneously?
π Lecture 63 β The eXtensible Markup Language
π Overview: This lecture introduces the eXtensible Markup Language (XML) as a standardized framework for designing notational systems to represent data as text files. It explains how XML enables the creation of markup languages like HTML for webpages and emphasizes the shift towards semantic-oriented tags, which could lead to a World Wide Semantic Web.
ποΈ Topics Covered
The lecture begins by showing how sheet music encoding uses tags like HTML, then introduces XML as a standardized style for designing notational systems. It covers the relationship between XML, SGML, and HTML, and explains how XML allows for semantic-oriented markup that emphasizes meaning over appearance, enabling advanced search capabilities and the potential for a Semantic Web.
π Lecture Summary
Module 75
The lecture uses the first two bars of Beethovenβs Fifth Symphony to illustrate sheet music encoding. This encoding system uses tags delineated by < and > symbols, similar to HTML. Structures like <staff> or <measure> are opened with a start tag (e.g., <measure>) and closed with an end tag containing a slash (e.g., </measure>). Attributes within tags are expressed as clef = "treble". This same style can represent other formats like mathematical expressions and graphics.
π Definition β Tags: Markers used to identify components of a document, delineated by < and > symbols, with end tags designated by a slash (</>).
The eXtensible Markup Language (XML) is a standardized style for designing notational systems to represent data as text files. XML is a simplified derivative of the older Standard Generalized Markup Language (SGML). Following the XML standard, markup languages have been developed for representing mathematics, multimedia, and music. HTML is the markup language based on XML for representing webpages, though original HTML was developed before XML was finalized, leading to XHTML, which rigorously adheres to XML.
π Definition β XML: A standardized style for designing notational systems (markup languages) to represent data as text files. π Definition β Markup Language: A notational system developed following the XML standard for representing specific types of data (e.g., mathematics, music, webpages).
π‘ Why this matters: XML provides a unified standard for developing markup languages, allowing them to be combined for complex applications like text documents containing sheet music and mathematical expressions.
XML allows for the development of new markup languages that emphasize semantics rather than appearance. For example, in HTML, recipe ingredients are marked as list items for appearance. With semantic-oriented tags, ingredients could be marked as <ingredient> and </ingredient>. This allows search engines to identify recipes containing or not containing specific ingredients, which is a substantial improvement over current word-based searches that might skip recipes stating "This lasagna does not contain spinach."
π Definition β Semantic-oriented tags: Tags that emphasize the meaning of data (e.g., <ingredient>) rather than its appearance (e.g., list items), enabling better data interpretation.
π‘ Why this matters: By using semantic tags and an Internet-wide standard, a World Wide Semantic Web could be created, replacing the current World Wide Syntactic Web.
β Key Takeaways
XML is a standardized framework for designing markup languages that represent data as text files, using tags and attributes similar to HTML. It is a simplified derivative of SGML and enables the creation of languages for mathematics, multimedia, and music. HTML is based on XML, but original HTML does not strictly conform, leading to XHTML. XML supports semantic-oriented markup, which emphasizes meaning over appearance, allowing search engines to perform more accurate searches (e.g., finding recipes without specific ingredients). This semantic approach could lead to a World Wide Semantic Web.
π§ Quick Revision Questions
- What is XML and what is its relationship to SGML?
- How does the use of semantic-oriented tags improve search engine functionality compared to standard HTML tags?
- What is the difference between the World Wide Semantic Web and the current World Wide Syntactic Web?
- Why does original HTML not strictly conform to the XML standard, and what is XHTML?
- Give an example of how the sheet music encoding system uses tags and attributes similar to XML.
π Lecture 76 β Networking and the Internet: Client Side and Server Side
π Overview: This lecture explores the fundamental concepts of networking, focusing on the Internet as a global system of interconnected computer networks. It distinguishes between the client side and server side of network communication, explaining how data is packaged, addressed, and transmitted across networks using protocols like TCP/IP.
ποΈ Topics Covered
The lecture introduces networking concepts, the Internet as a network of networks, and the client-server model. It explains IP addresses, domain names, and DNS. It covers TCP/IP protocols, ports, sockets, and how data flows from an application layer through transport, network, and link layers. It concludes with the client side and server side of communication.
π Lecture Summary
Networking
Networking is the practice of linking two or more computing devices together for the purpose of sharing data. Networks can range from small local area networks to the global Internet. The lecture emphasizes that networking is built on a set of protocols that define how data is formatted, addressed, transmitted, and received.
π Definition β Internet: A global system of interconnected computer networks that use the standard Internet Protocol Suite (TCP/IP) to link devices worldwide.
Client Side and Server Side
In a client-server architecture, the client is a program that requests services or resources, while the server is a program that provides those services or resources. When you browse a website, your browser (the client) sends a request to a web server, which then responds with the requested web page.
π Definition β Client: A computer or program that initiates requests to a server.
π Definition β Server: A computer or program that waits for and responds to requests from clients.
IP Address and Domain Name
Every device on a network is identified by a unique IP address (Internet Protocol address), which is a numerical label. However, humans find it easier to remember names, so domain names (like www.google.com) are used. The Domain Name System (DNS) translates domain names into IP addresses.
π Definition β IP Address: A unique numerical identifier assigned to each device on a network, used for addressing and routing data packets.
π Definition β Domain Name: A human-readable name that corresponds to an IP address, making the Internet easier to navigate.
π Example: When you type "www.example.com" into a browser, the DNS server looks up the IP address 93.184.216.34 and directs your request to that server.
Ports and Sockets
A port is a logical endpoint in network communication, identified by a number (0β65535). Different services use specific ports. For example, web traffic uses port 80 (HTTP) and port 443 (HTTPS). A socket is a combination of an IP address and a port number, forming a unique endpoint for communication.
π Definition β Port: A virtual point where network connections start and end, allowing multiple services on a single device.
π Definition β Socket: A software endpoint that binds an IP address and a port, enabling two-way communication between client and server.
π Example: A web server listening on port 80 at IP 192.168.1.10 has a socket represented as 192.168.1.10:80. A client at 10.0.0.5:54321 can connect to it.
TCP/IP Layer Model
The TCP/IP model is a conceptual framework that breaks network communication into four layers: Application, Transport, Internet, and Link. Each layer has specific protocols and responsibilities. The Application layer (e.g., HTTP, FTP) handles user services. The Transport layer (e.g., TCP, UDP) ensures reliable or fast data delivery. The Internet layer (IP) handles addressing and routing. The Link layer deals with physical hardware.
π Definition β TCP (Transmission Control Protocol): A connection-oriented protocol that guarantees reliable, ordered delivery of data between applications.
π Definition β UDP (User Datagram Protocol): A connectionless protocol that offers faster but less reliable data transmission.
π Example: When downloading a file, TCP ensures all packets arrive in order and are retransmitted if lost. For a live video stream, UDP may be used to avoid delays from retransmission.
π‘ Why this matters: Understanding the TCP/IP model helps in diagnosing network issues. If a web page fails to load, you can check whether the problem is at the application layer (wrong port), transport layer (firewall blocking TCP), or internet layer (wrong IP address).
β Key Takeaways
- The Internet is a network of networks, and every device is identified by an IP address.
- The client-server model separates requesting devices (clients) from responding devices (servers).
- Domain names are human-friendly labels converted to IP addresses by DNS.
- Data flows through layers in the TCP/IP model, with each layer handling specific functions like routing (IP) and reliability (TCP).
- Ports and sockets enable multiple services to run simultaneously on a single machine.
π§ Quick Revision Questions
- What is the difference between a client and a server in a network?
- How does DNS help when you browse a website?
- What is the purpose of a port number, and give an example for web traffic?
- Name the four layers of the TCP/IP model and one protocol for each.
- Why might a real-time video chat use UDP instead of TCP?
π Lecture 65 β Networking and the Internet: Layered Approach to Internet Software (I)
π Overview: This lecture introduces the four-layer model of Internet software that controls communication over networks. Using a package-shipping analogy, it explains how messages are passed down through layers at the source and back up at the destination. Understanding this layered approach is fundamental to grasping how the Internet reliably transmits data across diverse systems.
ποΈ Topics Covered
The lecture covers the four Internet software layers β application layer, transport layer, network layer, and link layer. It explains the process of message preparation and transmission as data moves downward through layers at the source, then upward at the destination. The material draws a parallel to a three-layer package-shipping example to illustrate how each layer adds specific handling without needing to know details of other layers.
π Lecture Summary
Package-shipping example
This section uses a package-shipping analogy to introduce the concept of layered systems. In the example, three layers (people and businesses) handle packages: one layer prepares the package, another routes it, and a third delivers it physically. Each layer only communicates with the layer directly above or below, and each adds its own header information (like addresses or handling instructions) to the package without altering the content.
π Definition β Layer: A collection of software routines or processes that perform a specific function in the communication chain, interacting only with adjacent layers. π‘ Why this matters: This isolation between layers allows changes in one layer (e.g., switching from wired to wireless transmission) without affecting other layers.
The four Internet software layers
In contrast to the three-layer shipping example, Internet software has four layers: the application layer, the transport layer, the network layer, and the link layer (Figure 74). A message originates in the application layer (e.g., an email or web request). From there, it is passed down through the transport and network layers as it is prepared for transmission. Finally, it is transmitted by the link layer over the physical network. At the destination, the message is received by the link layer and passed back up the hierarchy until it is delivered to the application layer at the messageβs destination.
π Definition β Application layer: The topmost layer where user-facing applications (e.g., web browsers, email clients) create messages. π Definition β Transport layer: The layer responsible for reliable end-to-end communication and data segmentation. π Definition β Network layer: The layer that handles routing and addressing, determining the path across networks. π Definition β Link layer: The bottommost layer that handles physical transmission over the actual hardware (e.g., Ethernet, Wi-Fi).
π Formula: Message flow at source: Application β Transport β Network β Link β physical medium π Formula: Message flow at destination: physical medium β Link β Network β Transport β Application
π Example: When you send an email, the email client (application layer) creates the message. The transport layer (e.g., TCP) breaks it into segments and adds port numbers. The network layer (e.g., IP) adds source and destination IP addresses. The link layer (e.g., Ethernet) adds MAC addresses and transmits the data as electrical signals over the wire. At the recipient's computer, the link layer receives the signals, then passes the data upward through the network and transport layers, which strip off their headers, until the email application receives the original message.
β Key Takeaways
The Internet software uses a four-layer model (application, transport, network, link) to manage communication reliably. Data flows downward through layers at the source as headers are added and upward through layers at the destination as headers are removed. Each layer performs a specific function independently, isolating changes to one layer from affecting others. The link layer handles physical transmission, while higher layers manage addressing, reliability, and application logic. Understanding this layered approach is essential for troubleshooting network issues and designing Internet-based applications.
π§ Quick Revision Questions
- What are the four layers of Internet software in order from top to bottom?
- How does a message flow through the layers at the source computer?
- What happens to the message when it reaches the destination computer?
- Why is a layered approach beneficial for Internet communication?
- How does the package-shipping analogy illustrate the concept of layers in Internet software?