~kjcole/edubuntu.cookbook-delete/wip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
<html>
<head>
  <title>Networking</title>
</head>

<body>
<h1>Networking</h1>

<h2>Why network?</h2>

<p>
On its own, a computer can be a fascinating tool. However, when you
connect many computers together using a network, worlds of possibility
open up. In a network, better use is made of all the connected
resources, because they can be shared. For example, if there is one
printer, everyone can use it. It is also possible to concentrate
resources where they will have the greatest benefit --- all the
additional memory added to the server becomes available for running
the programs of all the clients.
</p>
<p>
The advantages of networking only start with economies in
hardware expenditure. Another aspect, one that is really far
more exciting, is the opening up of communication channels
among lab users, and, if you can reach the internet, with the
world at large. Only some of the lab users will be interested
in computers for their own sake. Many more users will be
writing essays, asking questions, drawing pictures or
practising skills using the educational programs offered in a
Edubuntu lab. With a network, they can easily share documents,
discuss them, and have a record of discussions for the
learners that come after them.
</p>

<h3>Printing</h3>

<p>
An Edubuntu lab will usually have only one or two printers for the lab
as a whole. Since everyone will use these, it's worthwhile to get the
best printers you can afford: as long as they're on a network,
everyone will benefit.
</p>
<p>
Depending on the make of printer, it may be connected to the network
switch with a network cable, or it may be connected directly to a
print server (which may be the classroom server) with a parallel
cable.
</p>
<p>
Printing in an Edubuntu lab will be managed using CUPS, the Common
Unix Printing System. It provides a web interface (accessible at <a
href="http://printserver:631/">http://printserver:631/</a>) where you
may check the status of printers and print jobs, print test pages, and
so on. ( printserver is the hostname of the printer or the server to
which the printer is connected.)
</p>

<h3>Email</h3>

<p>
Email has been called the "killer application" of the internet. It's
the most ubiquitous and accessible way to communicate with people
across the world.
</p>

<p>
Not all Edubuntu labs have email. Generally, you'll only have email if
a Wizzy server is installed along with the classroom application
server. The Wizzy server functions as a post office and a stand-in, or
a proxy, for the world wide web.
</p>

<p>
If your Edubuntu lab is equipped with a Wizzy server, you'll be able
to send mail to each other and to other schools or mailing lists all
over the world.
</p>

<p>
XXX: How does Wizzy handle delivery of local email? Does that also go
via the Cape Town Wizzy server, and take a day for the round trip?
Probably not ..
</p>

<h3>File sharing</h3>

<p>
Without a network, transferring files from one computer to another is
a difficult and inconvenient process. You have to copy the file onto
some storage medium (such as a floppy disk or a CD) and carry it over
to the other computer yourself.  Floppy disks tend to break or become
silently corrupted. CDs can only be written once, and are relatively
expensive. Even rewritable CDs are slow to use, and even more
expensive.  Finally, all kinds of disk drives have many moving parts,
and they have to deal with a disk platter that spins hundreds of times
per second. They all break eventually.
</p>
<p>
<img src="illustrations/floppysilent.png" /> Watch out for this one,
it only looks innocent.
</p>
<p>
<img src="illustrations/floppyviolent.png" /> If you're lucky, the
floppy will let you know when it's broken.
</p>
<p>
It's much better to shift the job to network cables. Once laid, a
cable will keep on working forever. It doesn't cost anything to
transfer data over it, and it's very fast.
</p>
<p>
In the thin-client configuration of an Edubuntu lab, the reality is
even better. None of the client workstations store any data, so the
need for them to have internal hard disk drives has also been
eliminated. The only computer in an Edubuntu lab that must contain at
least one disk drive is the classroom server. Every user of the
Edubuntu lab --- in other words, every person with a username and
password to login at a workstation --- has some storage space on the
classroom server's hard drive allocated to them, where they may store
their data. They all reach their data via the network.
</p>

<p>
This means that making a copy of a file for another user comes down to
making a copy elsewhere on the same disk drive.  Similarly, for files
that many people need to share without necessarily needing their own
copies to modify, this means that everyone may access the exact same
copy of the file. In a non-networked situation, every single
workstation would need their own copy of such files. This is the case
for all the operating system and application software, for example.
</p>

<h3>Servers and clients</h3>

<p>
Without a network, every workstation needs to be sufficient unto
itself, and to provide all the storage space and processing power that
a user is likely to need. With the introduction of a network, it
becomes feasible to differentiate between computers, and equip them
according to their roles. For an Edubuntu lab, this means removing
everything that can break or costs money from the client workstations
--- their role is only to receive data over the network, and to
display the user's desktop, sent from the server. The server does all
the work, so it can have all the memory, disk space and computing
power that you can afford. Everyone benefits from money spent on the
server.
</p>

<h2>Equipment</h2>

<p>
In this section, we have a look at the different kinds of equipment
that we need to set up a network.
</p>
<p>
There are many different kinds of computer networks, with different
strengths and weaknesses. Some might be designed for the maximum data
transfer speed, some to minimise costs, and others to make it as easy
as possible to connect computers to one another. In the case of
Edubuntu labs, we need a really fast network, because everything
displayed by the client workstations needs to be sent from the server
over the network. We also need a standard network that allows any kind
of computer or peripheral to be added to the network easily.
</p>
<p>
In order to meet these criteria, Edubuntu lab uses an Ethernet network
with category 5 network cabling (CAT-5, for short).
</p>
<p>
In an Ethernet, data packets are broadcast onto the network for all
connected devices to receive. The devices themselves then examine the
data packet to determine whether it was meant for them. If so, they
process it; otherwise, they drop it on the floor and it vanishes.
</p>
<p>
The name "Ethernet" comes from the ancient Greek concept of
"ether". According to them, this was the fluid that filled the spaces
between stars. Of course there isn't any such thing, but they made it
up because surely there couldn't be nothing between stars, could
there? In an Ethernet, as far as the communicating computers are
concerned, there aren't any cables either. Of course there really are
cables, but you don't have to send a data packet down a specific cable
to a specific computer. You just entrust it to the "ether", and all
computers get the packet.
</p>

<h3>Switches / Hubs</h3>

<p>
There are different ways of wiring an Ethernet local area network. One
way is to simply lay coaxial cable from one computer to the next,
until all the computers are connected, forming a ring. This is
relatively simple, but the resulting network is slow, both because of
the electrical properties of the coaxial cable, as well as because all
the data has to share a single cable.
</p>
<p>
Since an Edubuntu lab needs more speed, a star topology is used
instead diagram. In this configuration, a single CAT-5 cable connects
each workstation to a central node. This central node acts as an
interchange. In a simple network where speed isn't critical, this node
can be a hub. This is a device with ports where you can plug in many
network cables; usually 8, 16 or 24. A hub is very chatty: it simply
repeats all the data coming in on one port on all the other
ports. This way, the data is sure to reach the computer it's meant
for.  Unfortunately, it also reaches all the other computers, taking
up precious network bandwidth.
</p>
<p>
Instead of a hub, you can also use a switch. It looks just like a hub,
but it's cleverer about routing the traffic that moves across it. In
short, it remembers which computer is where, so that when it receives
a data packet meant for a particular computer, it sends it only to the
port where that computer is connected.
</p>
<p>
Switches can be linked together to form one bigger switch. For
example, if you have a lab with 25 workstations, you can link together
two 16-port switches using a fly-lead. See Section 5.4.1.
</p>
<p>
<img src="illustrations/switch-flyleads.gif" /> Every switch has a
couple of special high-speed ports. These are used to link the switch
to the server, or to link switches to each other.
</p>

<h3>Cabling</h3>

<p>
Category 5 cable, commonly known as CAT-5, is an unshielded twisted
pair type cable designed for high signal integrity.  The actual
standard defines specific electrical properties of the wire, but it is
most commonly known as being rated for its Ethernet capability of 100
MBit/s. Its specific standard designation is EIA/TIA-568. CAT-5 cable
typically has three twists per inch of each twisted pair of 24 gauge
copper wires within the cable. Another important characteristic is
that the wires are insulated with a plastic (FEP) that has low
dispersion; that is, the dielectric constant of the plastic does not
depend greatly on frequency. Special attention also has to be paid to
minimising impedance mismatches at connection points. In practise,
this means that, when you attach connectors to the cable ends, you
shouldn't untwist more of the cable than absolutely necessary.
</p>

<h3>Building the network</h3>

<p>
When laying CAT-5 cable, you need a crimping tool, RJ-45 jacks, and
boots for the jacks.
</p>
<p>
The crimping tool is a clever piece of work. It combines the functions
of a cable-cutter, wire-stripper, and a special grip specifically
designed to fix the RJ-45 jack to the cable. I'll explain them as I go
through the steps of preparing a cable.
</p>

<p><img src="illustrations/netwerkkabelplug.png" /> An RJ-45</p>
<p><img src="illustrations/crimptool.png" /> A crimping tool</p>

<h4>Cutting the cables</h4>

<p>
The first thing you need to do, is to cut the cable into the
appropriate lengths, using the crimping tool's cable-cutter.  To do
this, measure the distance from the box where the switch will be
installed to the furthest computer in each row.  (Usually, in an
Edubuntu lab, there will be four rows of workstations.) It's easiest
to use the cable itself for this, and to mark the length with a piece
of masking tape.
</p>
<p>
To keep things organised, write something on the masking tape to
identify the computer which the cable is meant for. Label the rows
using a letter (so that you have rows A, B, C and D), and label each
computer in a row with a number (so that you have A1 to A8, and so
on). Once you have the longest cable in each row, you can figure out
all the other lengths by shortening each subsequent cable with the
distance between two workstations (normally, this will be 1200mm).
</p>
<p>
While you are cutting the cable into the right lengths, take care to
keep the cables for each row together. Bind all the cables for a row
together in a bundle, using masking tape. At the one end of the bundle
(the switch end) all the cable ends will be together. On the other
end, the ends will vary from the shortest to the longest.
</p>

<p>
Besides the cables from the switch to the workstations, you also need
to cut a couple of fly leads. These are used to connect the server(s)
to the switch, and also to link together multiple switches.
</p>

<h4>Laying the cables</h4>

<p>
Once all the cables have been cut and gathered together in bundles,
you can take them in to the lab. Put them on the ground underneath the
desks, and ensure that the cables at the switch end can comfortably
reach the switch.
</p>
<p>
If your network shares the same trunking with the electrical wiring of
the lab, you MUST switch off the lab's power at the electrical
subdivision board for the lab.
</p>
<p>
Now you need to put the cables inside the trunking. To do this, get as
much help as you can muster, as it's hard work and no fun to do
alone. Take the cover off the trunking. Note carefully where each
workstation will be standing, and drill a small hole in the trunking
below each workstation, for the CAT-5 cable to reach the
workstation. While the cables and the covers are lying on the floor,
thread each cable through the correct hole in the trunking (the cable
for computer A1 goes through the hole for A1, and so on).
</p>
<p>
Once this is done, carefully put the cables inside the trunking and
put the covers back on. Pass the cable ends up above the desks. You
should have about 1m free cable for each workstation.
</p>

<h4>Crimping the cables</h4>

<p>
Stepping back, your lab looks the same as before, with the addition of
cable ends emerging above the desks, and a whole bundle of cables
terminating at the switch cabinet. Now you need to attach RJ-45 jacks
to the cable ends, so that they can be plugged into the switch at the
one end, and into each workstation's network card on the other end.
</p>
<p>
To do this, complete the following steps for each cable.
</p>

<ul>
  <li>Insert the 'boot' over the cable. This will cover the exposed
  wires where the RJ-45 jack is attached to the cable wires.</li>

  <li>Cut through the sheath around the cable to expose the pairs of
  coloured wires, without damaging them.</li>

  <li>Untwist about 2cm of each pair of wires (no more, as this
  impairs the effectiveness of the cable for data transmission).</li>

  <li>Arrange the wires in the correct colour
  sequence. (Straight-through cabling for cables between the switch
  and workstations, or Cross-over cabling for fly leads that connect
  switches, or that connect the switch to the server).</li>

  <li>Insert the wires into the RJ-45 connector. Push them up so that
  all the wires terminate right at the tip of the connector.</li>

  <li>Check the colour sequence of the wires again.</li>

  <li>Crimp the wires to the connector using the tool. You'll notice
  that the connector has copper strips along the top. These connect to
  matching strips in the plug of the workstation's network card or the
  switch. When you crimp the connector, it bites into the wires
  through their plastic covering, connecting its copper strips to the
  copper wire. This is why it's critical to push the wires right up to
  the tip of the connector, so that the connector's teeth find the
  wire.</li>

  <li>Test the cable using a continuity tester, if you have one. If
  you don't, you'll just have to figure out whether it works by trial
  and error later.</li>

</ul>

<p><img src="illustrations/cablingcrossed.png" /> Cross-over CAT-5 cable</p>

<p><img src="illustrations/cablingstraight.png" /> Straight-through CAT-5 cable</p>

<h2>LANs and WANs</h2>

<p>
You have now constructed a local area network, or LAN. It's what gives
your Edubuntu lab life, but it stops at the classroom walls. To be
able to send and receive email or access the internet, it is necessary
to connect to further networks. This happens over a wide area network,
or WAN. A WAN is a computer network covering a wide geographical
area. The grandest example of a WAN is the internet.
</p>
<p>
WANs are used to connect local area networks together, so that users
and computers in one location can communicate with users and computers
in other locations. Many WANs are built for one particular
organisation and are private; others, built by internet service
providers, provide connections from an organisation's LAN to the
internet. This is the case with a Edubuntu lab that is connected to
the internet. Private WANs are most often built using leased lines. At
each end of the leased line, a router connects to the LAN on one side
and a hub or a switch within the WAN on the other. (XXX: diagram)
</p>
<p>
While a LAN is a network of computers and devices, a WAN is most often
a network of networks. A router, or a computer configured to function
as a router, on each network, connects to routers on other networks.
</p>
<p>
Behind every router there may be many computers (or networks) that are
not directly connected to the internet. It is then the function of the
internet gateway computer to route packets from outside networks to
the correct computer on the inside.  All the computers on a LAN share
a single connection to the internet. In the case of Edubuntu labs, the
Wizzy server, if you have one, acts as a gateway computer.
</p>
<p>
However, because a permanent WAN connection is very expensive in South
Africa, especially in rural areas where telecommunication
infrastructure may be lacking, an Edubuntu lab will connect to the
internet only intermittently. When it is not connected, the Wizzy
server acts as a proxy for the internet, serving cached requests, and
queueing email to send later when the connection is established again.
</p>

<h2>TCP/IP</h2>

<p>
The network protocol of the Edubuntu lab LAN is the same as that used
for communication on the internet, namely TCP/IP. This is the
Transmission Control Protocol (TCP), encapsulated within the Internet
Protocol (IP). The Internet Protocol takes care of routing data
packets from a source IP address to a destination IP address. An IP
address consists of four numbers that look like this: 192.168.10.200. 
IP packets can contain TCP packets. Whereas an IP packet only knows
where it should go, TCP packets contain information about their
position in a sequence of packets.
</p>
<p>
TCP is wonderful: it makes it possible to treat a flaky network as
though it were perfectly reliable. When you send anything across a
TCP/IP network (e.g. an email message, an image, or a document) it is
broken down into many TCP packets.  These are numbered and sent, one
by one, to the destination computer. At the destination, the sequence
number is used to put the packets in the correct order (as they may
have become mixed up in transit). If there are gaps in the sequence,
only those packets are requested again. If some packets are received
more than once, the extra packets are simply dropped.  Once all the
packets in the sequence have been received, the entire file has been
transferred successfully.
</p>
<p>
Unsurprisingly, an IP address cannot be just any four numbers.
Actually, there is a lot of underlying structure. In the first place,
the numbers are a sequence of four bytes. Computers generally handle
data one byte at a time, so it's convenient to specify things as a
sequence of bytes. A byte consists of eight binary digits. The binary
number system has only two digits, namely 0 and 1: just as 99999999 is
the largest number that you can express with eight decimal digits,
11111111 is the largest number that you can express with eight binary
digits. If you convert that number to decimal, you get 256.  For this
reason, a sequence like 300.5.502.743 does not make any sense as an IP
address.
</p>
<p>
In the second place, some address ranges are reserved. For example,
all the networks that start with 192.168.---.--- as their first two
digits are private, not routed on the internet. The whole public IP
address space is divided among ISPs. Each ISP gets a range of numbers
that they may portion out between its customers. This range of numbers
is described in terms of a netmask, a number which looks similar to an
IP address, but is used to match all the IP addresses that belong to a
particular network. Private networks can also be segmented into
subnets using netmasks. Any computer on a network can send IP packets
to any other computer on the network, but to send an IP packet to a
computer on a different network, there must be a gateway computer
which is configured to help the packets cross from one network to
another.
</p>
<p>
Gateway computers also implement network management policies, e.g. by
way of firewall software, that specify what traffic is allowed into
and out of a network.
</p>

<h2>LTSP, Wizzy, Wikipedia</h2>

<p>
On an Edubuntu lab LAN, there may be up to three important servers.
</p>

<ul>
  <li>Most importantly, there will always be an LTSP classroom server,
  which serves the desktop sessions of all the client
  workstations.</li>

  <li>If the Edubuntu lab makes use of the Wizzy solution for internet
  connectivity, there will be a Wizzy server functioning as mail
  server (using Courier for IMAP mail storage, and exim for sending
  and receiving of mail via SMTP) and web proxy (using wwwoffle). The
  address of this server will need to be configured in the mail
  clients and web browsers of all Edubuntu lab users. For mail clients
  (XXX: Thunderbird?), the proper ports on the Wizzy server needs to
  be configured as SMTP and IMAP server. This will normally be ports
  25 and 143 of XXX.myschool.Edubuntu lab.org.za. For web browsers,
  the Wizzy server needs to be configured as proxy server for all
  protocols (HTTP, SSL, FTP). wwwoffle, the proxy server, usually runs
  on port 3128.</li>

  <li>If a local mirror of the Wikipedia project has been installed,
  it will be available as a website on the LAN, e.g. at XXX
  http://wikipedia.myschool.Edubuntu lab.org.za/. As a website, it's
  served by apache, just like the administration pages of the Wizzy
  server. The Wikipedia and the mail server / web proxy server may be
  the same machine.</li>
</ul>

</body>
</html>