1. Objectives
2. Installing Node.js
WESTERN UNIVERSITY CANADA
FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
SE 3314B COMPUTER NETWORKS APPLICATIONS
Assignment 1: Client/Server Application
Due Date: March 5, 2021
3. Importing third-party modules
4. Task 1: The Images Management Server
> node ImageDB
4.1. Console Interface
4.2. Response packetization Module ITPResponse.js
0 0
1
2
3
4
5
6
7
8
9
1 0
1
2
3
4
5
6
7
8
9
2 0
1
2
3
4
5
6
7
8
9
3 0
1
V=7
F
Response Type
IC
Sequence number
Timestamp
IT
File name size
Image size in byte
These three fields (the payload) exist only if the IC is not zero, and could be repeated by the value of the IC
Image file name
Image data
4.3. Clients Handler Module ClientsHandler.js
4.4. Main Application ImageDB.js
5. Task 2: The Client Side
5.1. Console Interface
> node GetImage -s
5.2. Request packetization Module ITPRequest.js
0123 01234567890123456789012345678901
5.3. Main Application GetImage.js
V=7
IC
Reserved
Request Type
IT
File name size
Image file name
These three fields (the payload) could be repeated by the value of the IC
6. Testing Your Code
> node ImageDB
ImageDB server is started at timestamp: 256 and is listening on 127.0.0.1:3000
> node GetImage -s 127.0.0.1:3000 -q rose.gif parrot.jpeg -v 7 Connected to ImageDB server on: 127.0.0.1:3000
ITP packet header received:
11110000 00010001 00000011 10000101
00000000 00000000 00001111 10001011
Server sent:
ITP version = 7
Fulfilled = Yes
Response Type = Found
Image Count = 2
Sequence Number = 901
Timestamp = 3979
Disconnected from the server
Connection closed
> node ImageDB
ImageDB server is started at timestamp: 680 and is listening on 127.0.0.1:3000
Client-3979 is connected at timestamp: 3979
ITP packet received:
11100010 00000000 00000000 00000000
00110000 00000100 01110010 01101111
01110011 01100101 00100000 00000110
01110000 01100001 01110010 01110010
01101111 01110100
Client-3979 requests:
ITP version: 7
Image Count: 2
Request type: Query
Image file extension(s): GIF,JPEG
Image file name(s): rose,parrot
Client-3979 closed the connection
Client-14500 is connected at timestamp: 14500
ITP packet received:
11100001 00000000 00000000 00000000
00110000 00001101 01000010 01101100
01100101 01100101 01100100 01101001
01101110 01100111 01001000 01100101
01100001 01110010 01110100
Client-14500 requests:
ITP version: 7
Image Count: 1
Request type: Query
Image file extension(s): GIF
Image file name(s): BleedingHeart
Client-14500 closed the connection
Hand In
Reviews
There are no reviews yet.