You are on page 1of 12

Communications and Internet Technologies

What is "bit-streaming"?

Make separate bullet points for each mark you target:


● a sequence of digital signals/bits (binary digits)
● over a communication path
● bits arrive in the same order as they are sent
● the bandwidth must be high enough; eg to allow a user streaming a movie to
experience continuous audio and video

NOTE: terminology: the source is called the "producer"; the destination is called
the "consumer".

Advantages of "on-demand" streaming movies over downloading whole movies


● no need to wait for a whole file to be downloaded
● no need to store large files on user's computer

Disadvantages of streaming movies


● video stops / hangs if inadequate buffering capacity
● a loss of Internet means can't access films

NOTE: be as precise as possible; eg if question refers to streaming films, refer


to "films" rather than "data"

What is "broadcasting"?

NOTE: To "broadcast" means to transmit a signal to numerous recipients


simultaneously; so the term should be avoided in the context of on demand
bit-streaming, since there is only one recipient.

More correctly, on demand streaming uses "unicasting", which sends the stream to
one requesting recipient; live streaming may use "multicasting" which sends the
stream to many recipients at the same time.

ON DEMAND BIT STREAMING


● a digital video is encoded into a bit-streaming format
● the resulting file is uploaded to a dedicated streaming server
● users select the video from a webpage in their browser (eg by clicking a
hyperlink) to start downloading the encoded video stream from the server to the
user's computer
● any user of the website can watch the video at any time
● in practice, different files are used for each user
● users can: pause, rewind, fast forward, slow-motion replay, etc.
NOTE: (this is the same for on demand and live streaming)
AT THE USER END:
● the user's computer receives the streamed data into a buffer
● the user's media player decodes and synchronizes the data from the buffer

REAL TIME BIT STREAMING


● an event is captured live with a video camera
● connected to a computer
● the video signal is encoded into a bit-streaming format
● encoded files are uploaded to a dedicated streaming server
● although the real time stream itself cannot be paused, or support rewind, fast
forward, etc., some client media player software can store the video on local
backing storage, and provide user functions to: pause, rewind, fast forward,
replay, slow-motion replay, etc. for a limited time period

NOTE: (this is the same for on demand and live streaming)


AT THE USER END:
● the user's computer receives the streamed data into a buffer
● the user's media player decodes and synchronizes the data from the buffer

On demand bit-streaming

make separate bullet points:


● the video is encoded and stored as a file on the dedicated streaming server
● data is streamed to the client from the server as a stream of bits/bytes
● the streamed bits/bytes are stored in a buffer on the client
● the client media player reads the bits/bytes from the buffer

the importance of continuity and synchronization:


● the user's computer receives the streamed data into a buffer through the user's
internet connection
● the user's media player decodes and synchronizes the data from the buffer
● in order to output continuous video with no pausing, there must always be data
in the buffer for the media player to read
● so the bandwidth of the user's internet connection must be sufficient to
deliver at least the number of bits per second required by the media player to
output continuous video at the required resolution

NOTE: often several video files are made available encoded using different
resolutions, so that the user can select a lower resolution if their video output
is not continuous

The internet
● the internet is a global system of interconnected networks
● using the internet protocol suite (TCP/IP)

The world wide web (WWW):


● a collection of interlinked hypertext documents (web pages)
● stored on web sites hosted on web servers, accessed over the internet
Also:
● web pages are coded using hypertext markup language (HTML)
● secure hypertext transfer protocol (https) is used by the client browser to
request a web-page from the server, and receive the response

Describe the three components of the following URL (Uniform Resource Locator):
https://www.cie.org.uk/computerscience.html
Make 3 bullet points:
● HTTPS tells the browser what protocol is being used to access the information
in the domain
● cie.org.uk is the domain
● computerscience.html is the file name of the webpage being requested

What is the meaning of "%20" and "?" in a URL?

● %20 represents a space character (ordinal 32) in the URL


● ? precedes any parameters passed in the URL

to convert a denary number to hexadecimal (hex):

first convert to binary:


To convert a positive number to 8 bit binary, repeat division by 2
128 64 32 1 8 4 2 1
6
255/128 = 1 r 127 1
127/64 = 1 r 63 1
63/31 = 1 r 31 1
31/16 = 1 r 15 1
15/8 = 1 r 7 1
7/4 = 1 r 3 1
3/2 = 1 r 1 1
1/1 = 1 r 0 1
25510 = 111111112

then convert to hex:


111111112 = FF16 (11112 = F16)

NOTE:
a quick way: the next binary column to the left would have the value 256
so:
denary: 256 - 1 = 255
binary: 100000000 - 1 = 11111111
hex : 100 - 1 = FF

denary binary hex


256 128 64 32 16 8 4 2 1 256 16 1
255 0 1 1 1 1 1 1 1 1 F F
+1 +1 +1
256 1 0 0 0 0 0 0 0 0 1 0 0

What is the structure of an IPv4 address?


● an IPv4 address consists of 4 x 8-bit binary integers (in denary, in the range
0-255)
● usually displayed in denary, separated by dots eg 192.168.0.1

How is a URL "resolved" into an IP address?


● a URL (Uniform Resource Locator) is the address of a resource, probably in this
case a web-page, on the internet
● the URL includes the protocol to be used, and the domain name
● the browser sends the URL to the DNS (Domain Naming System)
● the domain name (eg cherwell-college.co.uk) is looked up using the DNS "Name
Resolver" on the local network
● to return the associated Internet Protocol (IP) address (54.246.110.160)
● if the URL is not in the local DNS server's database, the request is passed on
to another DNS server outside the local network
● the DNS is a hierarchical system
● in this case, the local DNS server adds the returned IP address and URL to its
cache/database
● the DNS server returns the IP address to the browser
● the DNS server may return an error message if the requested domain name is
invalid or does not exist

Examples of valid and invalid IPv4 addresses:

3.2A.6AA.BBBB is invalid because BBBB and 6AA are more than 8 bits
2.0.255.1 is valid because all values are in the range 0 - 255
6.0.257.6 is invalid because 257 > 255
A.78.F4.J8 is invalid because J is not a HEX digit/J8 is not a valid HEX number

NOTES:
a private IP address can only be reached within a LAN or intranet
a private IP address cannot be reached across the internet

NOTE: use bullet points, eg:


● the internet is a global system of interconnected networks using the internet
protocol suite (TCP/IP)
● the World Wide Web (WWW) is a collection of interlinked hypertext documents
hosted in web-sites on web-servers, accessed via the internet, transferred
using HTTP/HTTPS protocol

NOTE regarding IPv4 addresses:


The range of each of the four 8-bit binary numbers is 00000000 - 11111111. If you
give the range as 0-255, you should say "in denary".

NOTE:
you get a mark for saying that the internet and the WWW are not the same thing
using bullet points, one mark per bullet point, eg
● the internet is a system of interconnected networks
● using the internet protocol suite (TCP/IP)
● the World Wide Web (WWW) is a collection of interlinked hypertext documents
● accessed over the internet
Marks also awarded for:
● web-pages/hypertext documents are written in HTML (hypertext mark-up language)
● web-pages are transferred across the internet using HTTPS protocol (secure
hypertext transfer protocol)

Notes on comparison of copper cable vs. fibre optic cable:


one mark per bullet point, eg

Benefits of copper cable:


● it is easier to make terminations using copper cable
● copper cable is cheaper to install

Benefits of fibre optic cable


● fibre optic cable supports greater bandwidth
● fibre optic cable needs less signal boosting
NOTE:
According to the mark scheme, this answer is correct. (So if you get this question
again in the CIE exam, you'll know what to answer)

However, regarding the last entry "Fastest transmission medium", consider the
following points, which suggest that the mark scheme is in ERROR:
(1) radio in air is faster than light in fibre:
● the speed of light in a glass or plastic fibre, where light has to bounce along
the refractive index, is approx. 200,000 kms-1
● the speed of a radio signal in air is approx. 299,700 kms-1
This means that the latency (the time taken for the signal to travel) between two
buildings is lower for radio than for fibre.
eg: for two buildings 200m apart, radio takes 1064 μs (microseconds), light in
fibre takes 1594 μs (microseconds); (more than 500 μs longer)

(2) radio travels in a straight "line of sight", light in fibre does not, which
further increases the difference between the latency of light in fibre and the
latency of radio signals.

(3) there is less attenuation (loss of energy per metre) for light in fibre than
for radio signals, mainly because radio signals spread out.
Two benefits of the client-server model:
● resources are centralised (eg files on a file-server)
● so that security is managed effectively (eg access control, backup and
recovery)

NOTE:
the mark scheme does not contain the answers, just pointers to the examiner.
NOTE
Hardware required to connect a local area network to the internet:
(1) a modem (to modulate/demodulate the carrier wave on the telecommunications
provider's communications media connecting the network to the internet)
(2) a router (to forward each received message/packet to the correct destination
host)
(3) either a hub or a switch (to connect hosts)

Consider the following HTML code for a web-page:


1 <html>
2 <head>
3 <title>Amusement park visit ticket cost</title>
4 </head>
5 <body>
6 Calculate my ticket price
7 <Script Language = "JavaScript">
8 var groupSize = prompt("Enter number of visitors in your group)", "");
9 var groupPrice = groupSize * 20;
10 if (groupSize > 4)
11 {
12 groupPrice = groupPrice * 0.8;
13 }
14 alert("Price for the group is " + groupPrice);
15 alert("Thank you for your enquiry");
16 </Script>
17 </body>
18 </html>

NOTES:
- Javascript code:
● lines 8-15 contain the Javascript code
● lines 7 and 16 contain the enclosing html script tag

- local variables:
● identifiers of 2 variables: groupPrice, groupSize
● "var" precedes the declaration of any local variable

- a "selection" control structure: lines 10 - 13

- the "prompt" function:


● outputs a message asking the user for input
● returns the user input

NOTE: when defining, describing or explaining something, avoid using the word you
are defining as part of the answer (eg "prompt")

NOTE: Javascript is called "client-side scripting" because the web-browser


requests the web-page from a web-server, so the browser is the client (software).

Step-by-step, how a browser requests a web-page from a web-server


NOTE: if the web-page contains Javascript, this script is run by the client
browser as the final step:

● the browser parses the URL to obtain the domain name


● the browser passes the domain name (eg cherwell-college.co.uk) to the nearest
Domain Name Server (DNS) (on the local network)
● the DNS contains a list of domain names and matching IP addresses
● the DNS name resolver looks for the domain name in its database
● if found, the corresponding IP address is returned to the originator (eg
54.246.110.160)
● if not found, the request is sent to another higher level DNS (outside the
local network); the DNS is a hierarchical system
● the original DNS adds the returned IP address to its cache/database
● the original DNS returns the IP address to the originator; the DNS server may
return an error message if the requested domain name is invalid or does not
exist
● The browser uses the IP address to request the required web page from the web
server
● The web server retrieves the page and delivers it to the originator
● The browser software interprets the script and displays the web page

Consider the following HTML code for a web-page:


1 <html>
2 <head>
3 <title>Untitled Document</title>
4 <script language="JavaScript">
5 function myButton_onmousedown()
6 {
7 var Message1 = "ERROR – Order refused";
8 var Message2 = "Product code OK";
9 var x = document.forms["form1"]["txtProductCode"].value;
10 if (x == "")
11 {
12 alert(Message1)
13 }
14 else
15 {
16 alert(Message2)
17 }
18 }
19 </script>
20 </head>
21 <body>
22 <form name = form1>
23 <label>Product code: </label>
24 <input type="text" name="txtProductCode" >
25 <label>Number: </label>
26 <input type="text" name="txtNumber" size = "5" >
27 <p>
28 <label>Submit order: </label>
29 <input type="button" name="btnSubmit" Value = "Submit"
30 onMouseDown = "myButton_onmousedown()" >
31 </p>
32 </form>
33 </body>
34 </html>

VALIDATION

the following check exists in the above Javascript code:


Presence check on product code:
lines 10-17

Other possible validation checks which could be coded:

Length check
● for the Number, to make sure at least one character has been entered

Type check or Format check:


● for the Product code, to check it is in a particular format
● for the Number, to check that only numeric characters have been entered
Range check
● to check the Number entered is less than or equal to the available stock

Lookup check/existence check


● to check the product code exists on file/database

CLIENT-SERVER OPERATION

in general, client-server operation has 3 steps:


● the client requests the resource from the server
● the server retrieves the requested resource
● the server sends the retrieved resource to the client as the response

In particular, eg when requesting a file from a server, marks are awarded for any
2 of the following:
● The file is made available from a web/email/FTP server
● The user’s browser is the client software
● The client (software browser) requests the file from the server
● The desired file is returned to the client computer

Consider the following HTML code for a web-page:


1 <html>
2 <head>
3 <title>Untitled Document</title>
4 <script language="JavaScript">
5 function myButton_onmousedown()
6 {
7 var Output1 = "Runner ID OK";
8 var Output2 = "ERROR – entry refused";
9 var Runner ID = document.forms["form1"]["txtRunnerID"].value;
10 //
11 || in Javascript is the 'OR' operator
12 if (RunnerID.substr(0,3) == "VAR" || RunnerID.substr(0,3) == "CAM")
13 {
14 alert(Output1)
15 }
16 else
17 {
18 alert(Output2)
19 }
20 }
21 </script>
22 </head>
23 <body>
24 <form name = form1>
25 <label>Runner ID: </label>
26 <input type="text" name="txtRunnerID" >
27 <label>Position: </label>
28 <input type="text" name="txtPosition" size = "5" >
29 <p>
30 <label>Save data: </label>
31 <input type="button" name="btnSubmit" Value = "Submit"
32 onMouseDown = "myButton_onmousedown()" >
33 </p>
34 </form>
35 </body>
36 </html>

The identifiers of three local variables:


Output1
Output2
Runner ID

Javascript code:
lines 5-20

Javascript selection statement:


lines 12-19

The purpose of line 12:


Checks that the RunnerID entered starts with the characters CAM or VAR only

Other possible validation checks which could be coded:

Format check
● RunnerID is three letter characters followed by two digit characters
● Position is digit characters only

Length check
RunnerID has exactly five characters

Range check
The value for Position is greater than 0 and less than or equal to the number of
runners in the race

Presence check
The text box for RunnerID or Position is not empty

Existence check/Lookup check


To ensure that RunnerID has been registered

Uniqueness check/Lookup check


To ensure no two runners have the same number

in general, client-server operation has 3 steps:


● the client requests the resource from the server
● the server retrieves the requested resource
● the server sends the retrieved resource to the client as the response

In particular, eg when requesting a web-page containing a server-side script from


a web server:
STEP #1
● The browser requests the web page
STEP #2
● The web server accesses the page
● The web server processes / executes the code (server-side script)
● The web server produces the HTML for the web page / generates the web page
STEP #3
● The web server returns the web page to the client
● The client browser displays this web page

Consider the following HTML code for a web-page:

01 <html>
02 <body>
03
04 <p>Enter your mark</p>
05 <input id="Mark" value="0">
06 <button onclick="calcGrade()">Enter</button>
07
08 <script>
09 function calcGrade() {
10 var mark, grade;
11 mark = document.getElementById("Mark").value;
12 if (mark >= 90) {
13 grade = "A"
14 } else if (mark >= 80) {
15 grade = "B"
16 } else if (mark >= 70) {
17 grade = "C"
18 } else if (mark >= 60) {
19 grade = "D"
20 } else if (mark >= 50) {
21 grade = "E"
22 } else {
23 grade = "U"
24 }
25 alert("Your grade is " + grade)
26 }
27 </script>
28
29 </body>
30 </html>

Javascript:
lines 9-26

2 local variables declared:


mark, grade
line 10

the line number where output is produced:


line 25

local variable mark is assigned the value input by the user


into the text box with ID = "Mark":
line 11

Consider the following HTML code for a web-page:

01 <?php
02 if(isset($_GET['mark'])) {
03 echo "Grade: " . calculateGrade($_GET['mark']);
04 } else {
05 ?>
06
07 <form action="#" method="get">
08 Enter Mark: <input type="text" name="mark" /><br />
09 <input type="submit" value="Calculate" />
10 </form>
11
12 <?php
13 }
14
15 function calculateGrade($inputMark) {
16 $gradeChar = "U";
17 if($inputMark >= 80) $gradeChar = "A";
18 else if($inputMark >= 70) $gradeChar = "B";
19 else if($inputMark >= 60) $gradeChar = "C";
20 else if($inputMark >= 50) $gradeChar = "D";
21 else if($inputMark >= 40) $gradeChar = "E";
22 return $gradeChar;
23 }
24 ?>

PHP server-side script:


lines 1-5
lines 12-24

variables:
gradeChar
- declared as parameter passed to function calculateGrade() at line 15
inputChar
- declared and assigned a value "U" at line 16

line number where output is produced:


line 3

The purpose of the PHP script, lines 1-5:


NOTE:
Lines 7-10 is a form containing a text box with name = "mark"
Data entered into any text boxes on a form are sent
to the server-side $_GET array when method = "get"

line 2: checks whether any value entered in the text box with name = "mark"
has been sent to the server-side $_GET array
line 3: if so, function calculateGrade is called
passing this value as a parameter
the value returned from the call to function calculateGrade()
is concatenated after string "Grade : " and the resulting string output

You might also like