alphatetfundnmu

// TETFUND ICT PROGRAMME · ITEM 3 · PART 2

Network Programming, Installation and Web Programming

Lecture notes for participants · Nigeria Maritime University, Okerenkoko, Delta State

ItemDetail
DateWednesday 28 October 2026 (one full day)
Participants20 university staff and students
Resource personMukhtar Sabiu, Alpha Oneiro Ltd
What you needA laptop (or a phone) and internet. Nothing to install.
PracticeSeven small interactive labs on the Practice Lab page (link given in class)

// HOW TO USE THESE NOTES

// THE DAY

TimeWhat happens
08:30Welcome and pre-test
09:00Part 1: how networks work (bits, layers, addresses, subnetting, ports, cables, Wi-Fi, firewalls)
13:00Lunch and prayer
14:00Part 2: network programming (programs that talk, fetch, Python)
15:00Part 3: web programming (HTML, CSS, JavaScript, databases, security, going online)
17:15Mini-project, post-test, feedback

// BY THE END YOU CAN

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · NETWORKS

1. What is a network?

IN PLAIN WORDS

A network is two or more devices joined so they can share things: files, printers and an internet connection. Think of houses on one road.

Before networks, each computer was alone. To move a file you copied it to a flash drive and walked to another office. A network lets the file travel by itself, in seconds, to anyone allowed to get it.

// THE PARTS OF A NETWORK

PartWhat it doesEveryday picture
Device (host, node)Any computer, phone, printer or server on the networkA house on the road
Cable or Wi-FiCarries the signals between devicesThe road
SwitchJoins many devices in one buildingA junction in your compound
RouterJoins your network to other networksThe gate to the main highway
ClientA device that asks for a service, for example your browserA customer
ServerA computer that gives a service: web, email, filesA shop

// SIZES OF NETWORKS

NameMeaningExample
LANLocal Area Network: one building or campusThe NMU computer lab
WANWide Area Network: many places far apartTwo campuses linked by a provider
InternetAll networks of the world joined togetherEverything you open in a browser
IntranetA private network only for staff or studentsThe staff portal

// PROTOCOL: THE MOST IMPORTANT WORD

A protocol is a set of rules that both sides follow so they understand each other. If you greet someone in Hausa, they must answer in Hausa. Devices do the same: HTTP is the protocol of the web, SMTP is the protocol of email, and IP is the protocol that gives addresses.

PRACTICE 1

Draw your office or lab network on paper: devices, switch, router, and the way out to the internet. Label each part with the words above.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · THE CORE

2. Bits and bytes: how computers count

IN PLAIN WORDS

A computer only knows ON and OFF. We write ON as 1 and OFF as 0. Everything, words, photos and addresses, is built from many 0s and 1s.

One 0 or 1 is called a bit. Eight bits together are a byte. A byte can hold any number from 0 to 255. To read a byte, give each position a value: 128, 64, 32, 16, 8, 4, 2, 1. Add up the values where there is a 1.

1286432168421Number
11000000128 + 64 = 192
10101000128 + 32 + 8 = 168
000010108 + 2 = 10
11111111255 (everything on)

This is why every part of an IPv4 address stops at 255: it is one byte. An IPv4 address is four bytes, which is 32 bits.

// HOW TO CONVERT A NUMBER TO BINARY

  1. Start at 128. If the number is 128 or more, write 1 and subtract 128. Otherwise write 0.
  2. Move to 64 and repeat, then 32, 16, 8, 4, 2, 1.
  3. Example: 25. 128 no (0), 64 no (0), 32 no (0), 16 yes (1) leaves 9, 8 yes (1) leaves 1, 4 no (0), 2 no (0), 1 yes (1). Answer: 00011001.
PRACTICE 2

Write these in binary: 5, 10, 192, 255. Then read 00001111 and 11110000 as numbers. Check your answers in the Practice Lab, tab 1 (Binary).

WHY WE CARE

The subnet mask 255.255.255.192 looks strange until you see it in binary: 11111111.11111111.11111111.11000000. The 1s are the street and the 0s are the house numbers.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · LAYERS

3. The five layers: sending a letter

IN PLAIN WORDS

Sending data is like posting a letter. Many small jobs happen one after another. Each job belongs to a layer.

5 ApplicationHTTP, DNS, SSHData 4 TransportTCP, UDP (ports)Segment 3 NetworkIP, ICMP (addresses)Packet 2 Data linkEthernet, Wi-Fi (MAC)Frame 1 PhysicalCable, radio, fibreBits sender
LayerWhat it doesLetter storyExample
5 ApplicationThe program you useYou write the letterBrowser, email, WhatsApp
4 TransportCuts data into numbered pieces and checks they arrivePut the pages in numbered envelopesTCP, UDP, ports
3 NetworkAdds addresses and finds the routeWrite the address on the envelopeIP, routers
2 Data linkMoves data one step to the next deviceThe local postmanMAC address, switch
1 PhysicalSends the actual signalsThe road and the truckCable, Wi-Fi radio

When you send, data goes down the layers. When the other computer receives it, the data goes up. This is a model: real systems mix layers a little, but it helps us think and find faults.

FIND THE FAULT, BOTTOM UP

Layer 1: is the cable plugged in, is Wi-Fi on? Layer 2: right switch port or Wi-Fi name? Layer 3: has the device an IP address? Layer 4: is the right port open? Layer 5: is the program set up correctly?

PRACTICE 3

A student says: I am connected to Wi-Fi but no website opens. Which layer would you check first? Then which?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · LAYERS

4. Packets and headers: wrapping the message

IN PLAIN WORDS

Big messages are cut into small pieces called packets. Each layer adds a label (a header) in front, like boxes nested inside bigger boxes.

Why cut the message? Small pieces share the road fairly, and if one piece is lost only that piece is sent again. Every piece carries the address of the sender and the receiver.

Name of the pieceAdded byThe new label says
DataThe program(your message: a web request, an email)
SegmentTransport layer (TCP)From which port to which port, and the piece number
PacketNetwork layer (IP)From which IP address to which IP address
FrameData link layerFrom which MAC address to which MAC address, on this one hop
BitsPhysical layerElectrical, light or radio signals

// WORDS

WordMeaning
HeaderExtra information put in front of the data
PayloadThe real content being carried
EncapsulationAdding a header at each layer on the way down
De-encapsulationRemoving each header on the way up
HopOne step from one device to the next on the road

On the way, the IP addresses stay the same from start to end, but the MAC addresses change at every hop, because each hop has a different pair of devices.

PRACTICE 4

Open the Practice Lab, tab 3 (Packet journey). Type a short message and press Next layer. Write down what each layer added.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · ADDRESSES

5. MAC address and IP address

IN PLAIN WORDS

A MAC address is the name of the device. An IP address is where it is now. Names stay; addresses change when you move.

MAC addressIP address
Looks like00:1A:2B:3C:4D:5E192.168.10.25
Given byThe factory, burned into the network cardThe network (DHCP) or set by hand
Changes?NoYes, when you join another network
WorksOnly inside one local networkAcross networks
Size48 bits32 bits (IPv4)
Layer2 (data link)3 (network)
192 168 10 25 ... Network: 24 bits (mask 255.255.255.0) Host: 8 bits Default gateway: the router address (for example 192.168.10.1). DNS: turns names into IP addresses.

An IPv4 address has four numbers called octets because each is 8 bits. In 192.168.10.25, the first three numbers can be the street (the network) and the last number is the house (the device). Where the street ends is decided by the subnet mask.

IP CONFLICT

If two devices have the same IP address, mail goes to the wrong house and both lose connection. DHCP prevents this by giving each device a different address.

PRACTICE 5

In 172.16.5.200 which numbers are the network if the mask is 255.255.0.0? Which is the host part?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · ADDRESSES

6. Subnet mask, gateway, DNS and DHCP

IN PLAIN WORDS

When your laptop joins Wi-Fi it needs four settings: an address, a mask, a gateway and a DNS server. DHCP gives all four automatically.

SettingExampleWhat it is for
IP address192.168.10.25Who and where you are
Subnet mask255.255.255.0 (/24)Which part is the street
Default gateway192.168.10.1The router: the way out of your street
DNS server8.8.8.8The phone book that turns names into addresses

// DNS: THE PHONE BOOK

People remember names such as nmu.edu.ng. Computers need numbers. DNS (Domain Name System) answers the question: what is the IP address of this name? Your laptop asks the DNS server first, then talks to the real address. Command to try: nslookup nmu.edu.ng.

// DHCP: THE HELPER AT THE DOOR

DHCP (Dynamic Host Configuration Protocol) is a service on the router or a server. When you join, your device shouts: who am I? DHCP answers with an address, mask, gateway and DNS. The address is lent for a time, called a lease, then returned.

// OTHER WORDS

WordMeaning
Network addressThe first address of a network, the name of the street. Not given to a device.
Broadcast addressThe last address. A message sent here reaches every device on the network.
Static IPAn address set by hand. Used for servers and printers.
Dynamic IPAn address given by DHCP. Used for laptops and phones.
PRACTICE 6

Which of the four settings is missing if you can open a website by its IP address but not by its name?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · ADDRESSES

7. Public, private and NAT

IN PLAIN WORDS

Inside a building we use private addresses that are free to reuse. The router has one public address for the world and shares it among everyone inside. That sharing is NAT.

TypeRangesUse
Private10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
Inside homes, offices and campuses. Many places use the same ones.
PublicEverything elseUnique in the world. Websites and routers use these.

Private addresses cannot be reached from the internet, which is also a small protection. When your laptop (192.168.10.25) asks a website for a page, the router swaps your private address for its public one and remembers who asked. When the answer returns, the router swaps back.

// NAT (NETWORK ADDRESS TRANSLATION)

  1. Laptop sends a request from 192.168.10.25, port 50321.
  2. Router rewrites it to the public address, port 40001, and writes this in its table.
  3. Website answers to the public address, port 40001.
  4. Router looks in the table and forwards the answer to 192.168.10.25.

IPv4 has only about 4.3 billion addresses, which is not enough for every device. NAT is one reason the internet kept working. IPv6 has far more addresses and is slowly replacing it.

PRACTICE 7

Find the private address of your laptop (Lab A). Then search the web for: what is my ip. Are they the same? Explain why.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · SUBNETTING

8. Subnetting: cutting a network into floors

IN PLAIN WORDS

One big network is crowded and hard to protect. Subnetting cuts it into smaller networks, like floors in a building, each with its own rules.

Why subnet? (1) Less noise: broadcasts stay on their floor. (2) Better security: Finance and Students can be separated. (3) Easy management: one floor, one department. (4) Good use of addresses.

// THE RULE OF HOST BITS

An IPv4 address has 32 bits. The mask decides how many are network bits and how many are host bits. /24 means 24 network bits and 8 host bits.

PrefixMaskHost bitsAddressesUsable devices
/24255.255.255.08256254
/25255.255.255.1287128126
/26255.255.255.19266462
/27255.255.255.22453230
/28255.255.255.24041614
/30255.255.255.252242

Usable devices = addresses minus 2, because the first address is the network name and the last is the broadcast.

// BORROWING BITS

To make more networks we borrow bits from the host part. Borrow 1 bit and you get 2 networks. Borrow 2 bits and you get 4. Borrow 3 and you get 8. Each borrowed bit doubles the number of networks and halves the size of each.

PRACTICE 8

How many devices fit in a /27? How many bits do you borrow from a /24 to make 8 networks, and what is the new prefix?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · SUBNETTING

9. Worked example: four floors

IN PLAIN WORDS

Task: split 192.168.10.0/24 into 4 networks, one per department.

  1. We need 4 networks. 2 x 2 = 4, so we borrow 2 bits.
  2. /24 plus 2 borrowed bits is /26. The mask is 255.255.255.192.
  3. 6 host bits remain: 2 to the power 6 = 64 addresses per network, so 62 usable.
  4. The networks start every 64: .0, .64, .128, .192.
FloorNetworkDevicesBroadcastMask
1 Admin192.168.10.0/26192.168.10.1 to .62192.168.10.63255.255.255.192
2 Library192.168.10.64/26192.168.10.65 to .126192.168.10.127255.255.255.192
3 Students192.168.10.128/26192.168.10.129 to .190192.168.10.191255.255.255.192
4 Labs192.168.10.192/26192.168.10.193 to .254192.168.10.255255.255.255.192

The first usable address is often given to the router (the gateway), for example 192.168.10.1 for Admin and 192.168.10.129 for Students.

// PRACTICE QUESTIONS

  1. Split 192.168.20.0/24 into two equal networks. Give the mask, both network addresses and the usable range of each.
  2. A department has 25 computers. Which prefix is the smallest network that still fits them?
  3. Which network does 192.168.10.140 belong to in the table above?
  4. Why can't we give a device the address 192.168.10.63?
CHECK

Type any address and prefix into the Practice Lab, tab 2 (Subnet calculator). It shows the binary, the mask, the range and the broadcast, and can split the network for you.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · LAB A

10. Lab A: see your own network

IN PLAIN WORDS

Your laptop already has tools to ask the network questions. They are built in. No installation.

// OPEN THE COMMAND WINDOW

Windows: press the Windows key, type cmd, press Enter. Mac: press Command+Space, type Terminal, press Enter. Linux: open Terminal.

CommandWhat it doesMac or Linux
ipconfig /allShows your IP, mask, gateway, DNS and MAC addressifconfig or ip a
ping nmu.edu.ngAsks: are you there? Shows how long the answer tookping nmu.edu.ng
tracert nmu.edu.ngLists every router (hop) between you and the websitetraceroute nmu.edu.ng
nslookup nmu.edu.ngAsks DNS for the IP address of a namenslookup nmu.edu.ng

// READING THE RESULTS

// MY RESULTS

QuestionMy answer
My IPv4 address
My subnet mask
My default gateway
My DNS server
My MAC address
Ping time to nmu.edu.ng
Number of hops
PRACTICE 9

Is your address private? Ping your gateway. Ping 8.8.8.8. Then ping google.com. If the numbers work but the name does not, which service is broken?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · PORTS AND PROTOCOLS

11. Ports, TCP and UDP

IN PLAIN WORDS

The IP address finds the building. The port finds the room. TCP is a phone call that checks you heard. UDP is shouting across the road.

A computer can run many programs that use the network at the same time: a browser, email, a chat app. The port (a number from 0 to 65535) tells the computer which program should receive each packet. An IP address plus a port is called a socket, for example 93.184.216.34:443.

PortServiceProtocol
80WebHTTP
443Secure web (padlock)HTTPS
22Remote loginSSH
53NamesDNS
25 / 587Sending emailSMTP
110 / 143Reading emailPOP3 / IMAP
3389Windows remote desktopRDP

// TCP AND UDP

TCPUDP
Connects first?Yes, a three-step handshake (hello, hello back, ready)No, it just sends
Numbers the pieces?YesNo
Resends lost pieces?YesNo
SpeedSlower, safeFaster, may lose data
Used forWeb pages, email, file transferVideo calls, games, DNS questions

A closed port is a door that is locked. An open port with a program behind it is a door that answers. Attackers search for open doors, so a firewall keeps open only the ports that are needed.

PRACTICE 10

Which port does a normal web page use? Which port does the padlock version use? Why would a game choose UDP?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · PUTTING IT TOGETHER

12. You type nmu.edu.ng. What happens?

IN PLAIN WORDS

Everything you learned so far happens in less than a second whenever you open a web page.

  1. DNS: your browser asks the DNS server: what is the IP address of nmu.edu.ng? The answer is a number.
  2. Connect: your laptop builds a packet for that IP address, port 443 (HTTPS), and starts a TCP handshake.
  3. Gateway: the packet goes to your default gateway, the router. Your private address is swapped for the public one (NAT).
  4. Route: the packet is passed from router to router across the internet (you can see them with tracert).
  5. Server: the web server receives the request on port 443, runs its program and builds the page.
  6. Return: the page comes back in many packets along a similar road. Your browser puts them in order and draws the page.

// WHAT EACH PIECE DID

PieceJob in this story
DNSFound the address
IP addressTold routers where to send the packet
PortChose the right program on the server
TCPMade sure all pieces arrived, in order
Gateway and routerPassed the packet on
NATLet many private devices share one public address
MAC addressMoved the packet one hop at a time
HTTPSScrambled the conversation (explained in Part 3)
PRACTICE 11

Run tracert nmu.edu.ng again. Count the hops. Pick one hop and look up its name. Can you tell the country?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · EQUIPMENT

13. Cables and equipment

IN PLAIN WORDS

Cables carry signals. The wire colours must go in a fixed order so every plug and device agree which wire does what.

A network cable (UTP) has 8 thin wires twisted in 4 pairs. Twisting cancels electrical noise. The plug is called RJ45. The maximum length is 100 metres. The standard order is T568B.

Pin12345678
T568Bwhite/orangeorangewhite/greenbluewhite/bluegreenwhite/brownbrown

Hold the plug with the clip down and the contacts toward you when reading pins from the left, or follow your trainer. Straight cable: same order at both ends (computer to switch). Crossover: T568B at one end and T568A at the other (computer to computer, old equipment). Modern devices detect the type themselves.

// EQUIPMENT

DeviceWhat it does
Hub (old)Repeats every message to every port. Noisy. No longer used.
SwitchLearns which device is on which port and sends each message only there.
RouterJoins different networks and chooses the best road out.
Access pointGives Wi-Fi to devices and connects to the switch by cable.
ModemConverts the provider's signal to one your router understands.
FirewallAllows or blocks traffic by rules.
Patch panel, rackNeat place where cables end, labelled at both ends.
PRACTICE 12

Do the cable game in the Practice Lab, tab 4. Put the 8 wires in order without looking, then time yourself.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · EQUIPMENT

14. VLANs and Wi-Fi

IN PLAIN WORDS

A VLAN gives one switch several private rooms. Wi-Fi is radio, so nearby access points must use different channels.

// VLAN: VIRTUAL LAN

Without VLANs, every device on a switch can see every other. A VLAN splits the ports into groups. Staff computers go in VLAN 10 and students in VLAN 20. They cannot reach each other unless a router lets them, and the router can apply rules. It is cheaper and safer than buying two switches.

// WI-FI

Channel 1Channel 6Channel 11 Channels 1, 6 and 11 are the only set that never overlap. Give neighbouring access points different ones.
2.4 GHz5 GHz
RangeLong, passes wallsShorter
SpeedSlowerFaster
Crowded?Very (microwaves, Bluetooth)Less
ChannelsUse only 1, 6 and 11Many, do not overlap
PRACTICE 13

Three access points are close together. Which channels do you choose and why?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 1 · SECURITY AND SKILLS

15. Firewalls and troubleshooting

IN PLAIN WORDS

A firewall is a gatekeeper with a list of rules. The safest rule is: block everything, then allow only what is needed.

Internet Firewalldeny by default Campus LAN
RuleActionMeaning
Allow port 443 from anywhereAllowEveryone may open the HTTPS website
Allow port 22 from the ICT office onlyAllowOnly admins may log in remotely
Everything elseDenyClosed by default

Rules are read from top to bottom and the first match wins. Good firewalls keep logs, a diary of what was allowed and blocked, so you can find attacks and mistakes.

// TROUBLESHOOTING LADDER

  1. Layer 1: cable in, Wi-Fi on, lights green.
  2. Layer 2: right Wi-Fi name or switch port.
  3. Layer 3: does the device have an IP, mask and gateway? (ipconfig)
  4. Ping the gateway. If it fails, the problem is inside your network.
  5. Ping 8.8.8.8. If it fails, the problem is the internet connection or provider.
  6. Ping google.com. If the number worked but the name fails, the problem is DNS (try nslookup).
  7. Restart the device, then the router, then call the provider.
PRACTICE 14

Ping 192.168.1.1 works. Ping 8.8.8.8 works. Open google.com fails. What do you check next?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 2 · NETWORK PROGRAMMING

16. What is programming?

IN PLAIN WORDS

A program is a recipe of exact steps. The computer is a very obedient cook that does exactly what is written, nothing more and nothing less.

WordMeaningExample (JavaScript)
ProgramA list of instructionsEverything you write
LanguageA way of writing instructionsJavaScript, Python, PHP
VariableA labelled box that holds a valuelet age = 25;
FunctionA named recipe you can reusefunction hello() { }
ConditionA choiceif (age > 17) { ... }
LoopRepeat stepsfor (const s of list) { ... }
ArrayA list of values["ICT", "Library"]
ObjectA thing with named parts{name: "Amina", unit: "ICT"}
CommentA note for people, ignored by the computer// like this
BugA mistake in the programMissing bracket

// A TEA PROGRAM

water = 1 cup
sugar = 2 spoons
boil(water)
if (sugar is available) { add(sugar) }
repeat 10 times { stir() }
serve()

The same ideas appear in every language. Only the spelling changes. Today you will meet JavaScript (in the browser), Python (online), SQL (for data) and a little PHP (on the server).

PRACTICE 15

Write a program, in plain words, for withdrawing money from an ATM. Where are the conditions? Where is the loop?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 2 · NETWORK PROGRAMMING

17. Sockets: two programs talking

IN PLAIN WORDS

A socket is one end of a phone call between two programs. One program waits (the server). The other dials (the client).

Serversocket, bind, listen Clientsocket connect() accept(): connection open send(data) echo: same data back
  1. Server: bind to an address and port, then listen. It waits.
  2. Client: connect to the server's address and port. It dials.
  3. Server: accept. The call is open.
  4. Both sides send and receive data, then close.

// THE SAME IDEA IN PYTHON (FOR READING)

# server.py
import socket
s = socket.socket()
s.bind(("0.0.0.0", 5000))
s.listen()
conn, addr = s.accept()
data = conn.recv(1024)
conn.sendall(data)       # echo it back

# client.py
import socket
c = socket.socket()
c.connect(("127.0.0.1", 5000))
c.sendall(b"hello")
print(c.recv(1024))

Every web page uses sockets underneath: your browser is the client, the website is the server, and port 443 is the number dialled. You do not need to install anything today. The browser version of this idea comes next.

PRACTICE 16

Which side calls listen? Which side calls connect? What does 127.0.0.1 mean? (Answer: it always means this same computer.)

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 2 · LAB B

18. fetch: a program asking the web for data

IN PLAIN WORDS

fetch is a JavaScript command that sends a request over the network and waits for the answer. It is network programming in one line.

WordMeaning
APIA menu that programs use to ask other programs for data (no web page, just data)
JSONA simple text format for data: {"name": "Amina", "age": 30}
ConsoleA place in the browser (F12) where you type JavaScript and see results
RequestWhat the client sends: a method (GET, POST), an address, optional data
ResponseWhat the server sends back: a status code and data
thenMeans: when the answer arrives, do this next

// LAB B1: ASK DNS FOR AN ADDRESS

Open any web page. Press F12 (or right-click, Inspect), click Console, paste and press Enter:

fetch("https://dns.google/resolve?name=nmu.edu.ng&type=A")
  .then(r => r.json())
  .then(console.log)

Click the small arrow to open the answer. Find Answer, then data: that is the IP address of the website.

// LAB B2: SEND DATA WITH POST

fetch("https://jsonplaceholder.typicode.com/posts", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({title: "Hello", userId: 1})
}).then(r => r.json()).then(console.log)

The practice server answers with your data and a new id: 101. It does not save anything for real; it only pretends so that you can learn.

PRACTICE 17

Change the website name in B1. Change title in B2. Try /posts/1 and /users/1 with a normal GET: fetch("https://jsonplaceholder.typicode.com/users/1").

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 2 · LAB C

19. Python in the browser: subnet maths

IN PLAIN WORDS

Python can do in a second what we did on paper. Network engineers use it to plan and check big networks.

Open an online Python editor such as Programiz (programiz.com/python-programming/online-compiler) or Google Colab. Type the code and press Run.

import ipaddress
net = ipaddress.ip_network("192.168.10.0/24")
for sub in net.subnets(new_prefix=26):
    print(sub, sub.netmask, sub.num_addresses - 2)
LineMeaning
import ipaddressBring in Python's ready-made toolbox for IP maths
ip_network(...)Make an object that represents the network
for sub in ...Repeat for each smaller network
new_prefix=26Cut into /26 networks
print(...)Show the result on the screen

Expected result, four lines: 192.168.10.0/26 255.255.255.192 62, then .64/26, .128/26 and .192/26. It matches the table you made by hand.

// MORE THINGS TO TRY

a = ipaddress.ip_address("192.168.10.25")
print(a.is_private)                         # True
print(a in ipaddress.ip_network("192.168.10.0/24"))   # True
REAL LIFE

Companies use tools such as Netmiko to log in to many switches by SSH and configure them with Python. It needs real devices, so we only talk about it today. The idea is the same: a program does repetitive network work.

PRACTICE 18

Change 26 to 27. How many networks do you get, and how many devices does each hold? Compare with Practice 8.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · WEB PROGRAMMING

20. How a website works

IN PLAIN WORDS

A website is a restaurant. The browser is the customer, the server code is the waiter and kitchen, and the database is the store room.

BrowserHTML, CSS, JSwhat users see PHPrules, sessionsvalidation MySQLtables on diskusers, tasks HTTPHTML SQLrows Validate input in PHP. Bind values in SQL. Never join strings into a query.
PartRuns whereLanguagesVisitor can see it?
Front endIn the browserHTML, CSS, JavaScriptYes, everyone can view the source
Back endOn the serverPHP, Python, Node.jsNo, only its output
DatabaseOn the serverSQL (MySQL, SQLite, PostgreSQL)No

// THE URL

https://www.nmu.edu.ng/news?id=5
^^^^^   ^^^^^^^^^^^^^  ^^^^  ^^^^
protocol  domain      path  query

// REQUEST AND RESPONSE

CodeMeaningPlain words
200OKIt worked
301 / 302RedirectLook at this other address
401UnauthorizedPlease log in
403ForbiddenYou are not allowed
404Not foundNo such page
500Server errorThe server broke
PRACTICE 19

Open a website. Press F12 and click the Network tab. Reload. Find the first request and its status code. How many requests did one page need?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · FRONT END

21. HTML: the structure

IN PLAIN WORDS

HTML is the walls and rooms of the house. It says what is on the page (a heading, a picture, a button), not how it looks.

WordMeaningExample
TagA label in angle brackets<h1>
ElementOpening tag + content + closing tag<p>Hello</p>
AttributeExtra information in a tag<a href="https://nmu.edu.ng">
HeadingTitles from h1 (biggest) to h6<h2>News</h2>
ParagraphA block of text<p>...</p>
LinkGoes to another page<a href="...">Home</a>
ImageA picture<img src="logo.png" alt="Logo">
ListBullets or numbers<ul><li>One</li></ul>
FormCollects data from visitors<form><input><button></form>

// A SMALL PAGE

<!DOCTYPE html>
<html>
<head><title>NMU ICT</title></head>
<body>
  <h1>NMU ICT Unit</h1>
  <p>Welcome to ICT.</p>
  <a href="https://nmu.edu.ng">University website</a>
  <form>
    <input name="email" placeholder="Your email">
    <button>Send</button>
  </form>
</body>
</html>

Almost every tag opens and closes: <p> ... </p>. The most common mistake is forgetting the closing tag. The <head> holds information about the page; the <body> holds what visitors see.

PRACTICE 20

Open codepen.io, start a new Pen, and type this page into the HTML box. Add a second heading and a list of three items.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · FRONT END

22. CSS: the look

IN PLAIN WORDS

CSS is the paint, curtains and furniture. The same HTML can look completely different with other CSS.

h1 { color: teal; font-size: 32px; }
.card {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}
#menu { background: #0b1b33; color: white; }
WordMeaning
SelectorChooses what to style: h1 (all h1), .card (class), #menu (one id)
Property and valuecolor: teal; means: the property color gets the value teal
ClassA reusable name you add to many elements: class="card"
Box modelEvery element is a box: content, then padding (inside space), border, then margin (outside space)
Flexboxdisplay:flex puts items in a row or column neatly
Griddisplay:grid puts items in rows and columns
Media queryDifferent styles for phone and big screen
ResponsiveA page that adapts to any screen size

// MAKING A PAGE WORK ON A PHONE

<meta name="viewport" content="width=device-width, initial-scale=1">

#list { display: block; }
@media (min-width: 700px) {
  #list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

Read it as: by default stack the items. If the screen is at least 700 pixels wide, show two columns. Most visitors in Nigeria use phones, so always design for a small screen first.

PRACTICE 21

Add CSS to your Pen: a teal heading, a bordered card, and a media query. Resize the preview window to see it change.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · FRONT END

23. JavaScript: the behaviour

IN PLAIN WORDS

JavaScript is the electricity. It makes lights and doors react when somebody clicks, types or taps.

WordMeaningExample
VariableA labelled boxlet name = "Amina";
constA box whose label never changesconst pi = 3.14;
FunctionA reusable blockfunction greet() { alert("Hi"); }
EventSomething the visitor doesclick, input, submit
DOMThe page as objects JavaScript can changedocument.querySelector("h1")
ArrayA list["ICT", "Library"]
Arrow functionShort function formx => x * 2

// REACTING TO A CLICK

const btn = document.querySelector("button");
btn.addEventListener("click", () => {
  document.querySelector("h1").textContent = "You clicked!";
});

Read it: find the button; when it is clicked, find the heading and change its text. The browser turns your HTML into a tree called the DOM, and JavaScript can read and edit any part of the tree.

// THE THREE LANGUAGES TOGETHER

HTMLCSSJavaScript
What is on the pageHow it looksWhat it does
WallsPaintElectricity
NounAdjectiveVerb
SAFETY

Never put user text into a page with innerHTML. Use textContent. You will see why in the XSS pages.

PRACTICE 22

Add a button to your Pen that changes the heading colour when clicked. Hint: element.style.color = "red".

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · LAB D

24. Lab D: staff directory with live search

IN PLAIN WORDS

You will build a real interactive page in CodePen: a list of staff that filters while you type.

Open codepen.io, click Start Coding. Type these into the HTML, CSS and JS boxes. If CodePen is blocked, use jsfiddle.net.

// HTML

<h1>NMU ICT Staff</h1>
<input id="q" placeholder="Search a name">
<div id="list"></div>

// CSS

body { font-family: sans-serif; margin: 16px; }
input { padding: 10px; width: 100%; max-width: 420px; }
.card { border: 1px solid #ccc; border-radius: 8px; padding: 12px; margin: 8px 0; }
@media (min-width: 700px) { #list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }

// JAVASCRIPT

const staff = [
  {name: "Amina Bello", unit: "ICT", phone: "0800 000 0001"},
  {name: "Tunde Okoro", unit: "Library", phone: "0800 000 0002"},
  {name: "Ibrahim Musa", unit: "Registry", phone: "0800 000 0003"},
  {name: "Grace Ebi", unit: "Bursary", phone: "0800 000 0004"}
];
const list = document.querySelector("#list");
function show() {
  const text = document.querySelector("#q").value.toLowerCase();
  list.textContent = "";
  staff.filter(s => s.name.toLowerCase().includes(text)).forEach(s => {
    const d = document.createElement("div");
    d.className = "card";
    d.textContent = s.name + " · " + s.unit + " · " + s.phone;
    list.appendChild(d);
  });
}
document.querySelector("#q").addEventListener("input", show);
show();
HOW IT WORKS

show() clears the list, keeps only the staff whose name contains the typed text, and draws a card for each. The last lines run show() each time you type, and once at the start.

CHALLENGE

Add three more staff. Add a Sort button. Add a field that shows how many staff match. Bad day? Read the red message in the console and fix the first error only.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · DATA

25. Databases and SQL from zero

IN PLAIN WORDS

A database is a set of Excel-like tables that programs can read and write fast and safely. SQL is the language you use to talk to it.

WordMeaning
TableA sheet with a name: users, tasks
Row (record)One entry in the table
Column (field)One kind of information: email, role
Primary keyA unique number for each row, usually id
Foreign keyA column that points to a row in another table (user_id in tasks)
QueryA question or command to the database

// THE FIVE COMMANDS

CREATE TABLE users (id INTEGER PRIMARY KEY, email TEXT, role TEXT);
INSERT INTO users (email, role) VALUES ('amina@nmu.edu.ng', 'staff');
SELECT * FROM users;
SELECT email FROM users WHERE role = 'admin';
UPDATE users SET role = 'admin' WHERE id = 1;
DELETE FROM users WHERE id = 1;
CommandMeaning
CREATEMake a table
INSERTAdd a row
SELECTRead rows (WHERE chooses which)
UPDATEChange rows
DELETERemove rows
WARNING

UPDATE and DELETE without WHERE change or remove every row. Always write WHERE first.

LAB: SQL PLAYGROUND

Open sqliteonline.com, choose SQLite, and run the lines above one at a time with Run. Add three users, then select only the admins. Use single quotes only.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · BACK END

26. Server code, sessions and REST

IN PLAIN WORDS

The back end is code on the server that receives a request, talks to the database and sends back a page or data. Logging in is a conversation: prove who you are once, then show your ticket every time.

// REGISTER AND LOGIN

  1. Register: the visitor sends email and password. The server makes a hash of the password and saves the email and the hash. Never the real password.
  2. Login: the server finds the user, hashes the typed password and compares with the saved hash.
  3. If they match, the server starts a session: a record on the server saying this visitor is logged in. It sends the browser a cookie, a small note with the session number.
  4. On every next request the browser sends the cookie, so the server knows who you are.
  5. Logout: the server destroys the session.
// PHP, shown for reading
$hash = password_hash($pw, PASSWORD_DEFAULT);
$st = $pdo->prepare("INSERT INTO users (email, password_hash) VALUES (?, ?)");
$st->execute([$email, $hash]);
// at login:
password_verify($pw, $savedHash);

// REST API

An API lets programs ask each other for data. REST is a tidy style: one address per thing, one method per action, answers in JSON.

MethodAddressMeaningStatus
GET/api/tasksRead the list200
POST/api/tasksCreate a task201
PUT/api/tasks/5Change task 5200
DELETE/api/tasks/5Remove task 5204

You used GET and POST in Lab B. A web page with fetch can call such an API and draw the answer without reloading.

PRACTICE 23

Why must the cookie not contain the password? What happens to the session when the user logs out?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · SECURITY

27. Passwords: hash, salt and encryption

IN PLAIN WORDS

Never store the real password. A hash is like a meat mincer: you can turn meat into mince, but never mince back into meat.

WordMeaningUse
HashA one-way scramble. Same input always gives the same output. It cannot be reversed.Storing passwords
SaltRandom extra text added before hashing so two users with the same password get different hashes.Protects against ready-made tables of hashes
EncryptionScrambling that can be undone with a key.HTTPS, files, messages
KeyThe secret that locks and unlocks encryption.

// WHY HASH?

If a hacker steals a database of real passwords, every account is lost, and because people reuse passwords, their other accounts too. If only hashes are stolen, the hacker must guess passwords one by one. Good hashes (bcrypt, Argon2, PHP password_hash) are slow on purpose to make guessing expensive. Plain MD5 or SHA-256 alone are too fast for passwords.

// SEE IT YOURSELF

// STRONG PASSWORDS

PRACTICE 24

Explain in one sentence the difference between hashing and encryption. Which one do we use for passwords?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · SECURITY

28. The three common attacks

IN PLAIN WORDS

Attackers use the places where a website trusts what a visitor types. The cure is the same each time: treat everything typed as dangerous until proven safe.

// 1. SQL INJECTION

The attacker types part of a command into a box. Example in the email box: amina@nmu.edu.ng' --. The two dashes start a comment, so the password check is cut off:

SELECT * FROM users WHERE email = 'amina@nmu.edu.ng' --' AND password = '...'

Fix: prepared statements. The command is written first with empty slots (?). The values go in separately and are always treated as plain data.

// 2. XSS (CROSS-SITE SCRIPTING)

A visitor saves a comment that contains a script. Every other visitor's browser runs it, and it can steal their session. Fix: show text as text. Use textContent in JavaScript and htmlspecialchars() in PHP so that < becomes a harmless symbol.

// 3. CSRF (CROSS-SITE REQUEST FORGERY)

While you are logged in, another website tricks your browser into sending a request, such as change my email. Fix: put a secret token in every form and check it, and set cookies as SameSite.

AttackWhat is abusedFix
SQL injectionText glued into a database commandPrepared statements
XSSText shown as code in the pageEscape output, textContent
CSRFThe browser's saved loginSecret tokens, SameSite cookies
RULE

Only test practice pages. Attacking a real website without permission is a crime.

PRACTICE 25

Practice Lab: tab 6 (SQL injection) and tab 7 (XSS). Try the attack buttons in unsafe mode, then repeat in safe mode. Write what changed.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// PART 3 · GOING ONLINE

29. HTTPS, Git, GitHub and GitHub Pages

IN PLAIN WORDS

HTTPS scrambles the conversation so nobody in the middle can read it. Git saves your work in steps. GitHub keeps a copy online and can show your page to the world for free.

// HTTPS

WordMeaning
HTTPThe web protocol; messages are readable by anyone on the road
HTTPSHTTP inside a secure tunnel (port 443, padlock)
TLSThe system that builds the tunnel
CertificateA digital ID card for a website, signed by a trusted authority
Man in the middleSomeone secretly listening or changing the messages

Without HTTPS, a password typed on public Wi-Fi can be read by anyone nearby. Click the padlock in the browser and look at the certificate.

// GIT AND GITHUB

WordMeaning
RepositoryA project folder that Git tracks
CommitA saved point in time, with a note
BranchA safe copy for trying new ideas
MergeBring a branch back into the main one
Push / pullUpload to / download from GitHub

// PUBLISH YOUR PAGE (GITHUB PAGES)

  1. Create a free account at github.com.
  2. Click New repository, name it my-first-site, choose Public, tick Add a README, Create.
  3. Click Add file, then Create new file, name it index.html, paste your page, click Commit changes.
  4. Open Settings, then Pages. Under Branch choose main and / (root), then Save.
  5. Wait about a minute. Your site is at https://yourname.github.io/my-first-site/ with a padlock.
  6. Edit index.html on GitHub and the live page updates.
PRACTICE 26

Send your link to the person next to you. Open theirs. Is there a padlock? Who issued the certificate?

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// MINI-PROJECT

30. Build in pairs: your department page

IN PLAIN WORDS

Make a small web page for one NMU unit and put it online. 45 minutes. Pass mark 60 out of 100.

ItemMarksTick
Page and content: heading, 3 sections, contact form (HTML and CSS)25
Works on a phone (media query, viewport)15
JavaScript behaviour: search box or button20
A fetch call to the test API, result shown on the page15
Published on GitHub Pages15
Network diagram and IP plan for the unit, drawn in app.diagrams.net10
Total100

// STEP BY STEP

  1. Choose a unit: Library, Registry, ICT, Bursary, Student Affairs.
  2. Open CodePen. Build the HTML, then the CSS, then the JavaScript.
  3. Add a fetch to jsonplaceholder.typicode.com/users and list five names under Our partners.
  4. Test on your phone or by narrowing the preview.
  5. Copy the code to index.html on GitHub and publish with Pages.
  6. Open app.diagrams.net (choose Device, no sign-in needed) and draw: internet, router, switch, four floors with the IP plan from Section 9.
  7. Show your page and diagram to the class (2 minutes).
FOR THE TRAINER

Each pair is scored on the table above. Everyone who reaches 60 passes. Marks are recorded on the scoring sheet.

// CHECKLIST BEFORE YOU SHOW

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// REVISION

31. Practice questions

IN PLAIN WORDS

Try all 30 without looking, then check the answers on the next page. Mark the ones you got wrong and read that page again.

  1. What is a protocol?
  2. How many bits are in a byte?
  3. Write 10 in binary.
  4. What is the largest number a byte can hold?
  5. Name the five layers from top to bottom.
  6. Which address is fixed in the network card?
  7. What does DNS do?
  8. What does DHCP do?
  9. What does NAT do?
  10. How many usable devices in a /26?
  11. What is the mask for /25?
  12. Which address ends 0 and which ends 255 in a /24?
  13. Which port is HTTPS?
  14. Which is faster, TCP or UDP, and why?
  15. What is the T568B order?
  16. Which 2.4 GHz channels do not overlap?
  17. What does deny by default mean?
  18. What does a VLAN do?
  19. What does ping do?
  20. What does the server do in a socket pair?
  21. What is JSON?
  22. Which language shows structure, which shows look, which shows behaviour?
  23. What is a primary key?
  24. Which SQL command reads rows?
  25. Why do we hash passwords?
  26. What is a salt?
  27. What stops SQL injection?
  28. What stops XSS?
  29. What does the HTTPS padlock mean?
  30. What is a commit?
NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// REVISION

32. Answers

#Answer
1A set of rules both sides follow to talk.
28.
300001010.
4255.
5Application, Transport, Network, Data link, Physical.
6The MAC address.
7Turns a name into an IP address.
8Gives IP settings automatically.
9Lets many private addresses share one public address.
1062.
11255.255.255.128.
12The network address (not used) and the broadcast address (not used).
13443.
14UDP, because it does not check or resend.
15white/orange, orange, white/green, blue, white/blue, green, white/brown, brown.
161, 6 and 11.
17Everything is blocked unless allowed.
18Splits a switch into private groups of ports.
19Checks whether another device answers and how fast.
20Waits and accepts the call.
21A simple text format for data.
22HTML, CSS, JavaScript.
23A unique number for each row.
24SELECT.
25So a stolen database does not reveal the real passwords.
26Random text added before hashing so equal passwords give different hashes.
27Prepared statements.
28Escaping output / showing text as text.
29The connection is encrypted.
30A saved point in time in Git.
PRACTICE ANSWERS

P2: 5=00000101, 10=00001010, 192=11000000, 255=11111111; 00001111=15; 11110000=240. P3: layer 1, then 2, then 3. P5: 172.16 is the network, 5.200 is the host. P6: DNS. P8: /27 = 30 devices; borrow 3 bits, prefix /27. Worked-example Q1: 192.168.20.0/25 mask 255.255.255.128, usable .1-.126; 192.168.20.128/25 usable .129-.254. Q2: a /27 (30 devices) fits 25 computers. Q3: 192.168.10.140 is in 192.168.10.128/26. Q4: .63 is the broadcast address of the first network. P13: channels 1, 6 and 11. P14: DNS settings or the DNS server. P18: 8 networks of 30 devices.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// REFERENCE

33. Word list

WordMeaning
APIA menu programs use to ask each other for data
ArrayA list of values
BandwidthHow much data can pass in a second
Bit / byteOne 0 or 1 / eight bits
BranchA safe copy of a project in Git
BroadcastA message sent to all devices on a network
Client / serverThe program that asks / the program that answers
CommitA saved point in a Git project
ConsoleBrowser place to type JavaScript
CookieA small note in your browser holding a session number
CSRFForged request using your logged-in browser
CSSThe language of the look of a page
DHCPGives IP settings automatically
DNSTurns names into IP addresses
DOMThe page as objects JavaScript can change
EncryptionScrambling that can be undone with a key
FirewallA gatekeeper with rules
FunctionA named reusable recipe
GatewayThe router address leading out of your network
HashA one-way scramble
HeaderExtra information in front of data
HTMLThe language of the structure of a page
HTTP / HTTPSThe web protocol / the secure version
IP addressWhere a device is on a network
JavaScriptThe language of page behaviour
JSONA text format for data
LAN / WANLocal / wide area network
MAC addressThe fixed name of a network card
NATMany private addresses share one public address
OctetOne of the four numbers of an IPv4 address
PacketA small piece of data with an address label
PortA number naming a program on a computer
Primary keyA unique number for each table row
ProtocolRules both sides follow
QueryA question or command to a database
RESTA tidy style of API using GET, POST, PUT, DELETE
RouterJoins different networks
SaltRandom text added before hashing
SessionThe server's memory that you are logged in
SocketOne end of a program-to-program connection
SQLThe language of databases
SQL injectionTyping part of a database command into a form
SSIDThe name of a Wi-Fi network
SubnetA smaller network cut from a bigger one
SwitchSends each message only to the right port
TCP / UDPReliable and ordered / fast but may lose data
TLSThe system that makes HTTPS secure
VLANPrivate groups of ports on one switch
XSSAttack that runs the attacker's script in others' browsers
NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page

// YOUR NOTES

My notes and questions

Write down what you want to remember, and questions to ask the trainer.

AFTER THE TRAINING

Rebuild one lab on your own this week. Keep your page on GitHub. Teach one colleague what you learned. That is the best way to remember it.

NMU ICT TRAINING // 28 OCT 2026Mukhtar Sabiu · Alpha Oneiro Ltd · page