[20 marks]
Hardware modifications:
The system hardware would have to be modified to accommodate the
four interrupt request signals coming out of the DUART on pins
OP4, OP5, OP6 and OP7.
Four wires would need to be provided to carry the four IRQ signals, and
the signals would need to be assigned interrupt priority levels
(in the range 0b001 to 0b111) by the interrupt circuitry.
In the 68332, the four wires could simply be connected to four different
IRQ inputs.
Software modifications: If the four hardware interrupts are to be handled with four separate interrupt service routines (the most likely scenario), then those four routines would need to be designed and the four corresponding exception vectors would need to be installed at the correct locations in the exception vector table. If the four hardware interrupts are handled by a single interrupt service routine, then a single conventional DUART interrupt service routine would need to be designed. This routine would need to have statements that determine the currently active interrupt conditions.
Autovectored interrupts would be simplest to use: each of the four DUART interrupt signals could be assigned to one of the 7 available interrupt priority levels. As mentioned above, in a 68332-based system the four IRQ wires could just be connected to four different IRQ inputs. Fast IRQ handling could then be provided by four separate interrupt service routines. The four corresponding exception vectors would of course need to be installed in the exception vector table.
User interrupts would not be as attractive as autovectored interrupts since the DUART can only store one exception vector number in its IVR. If this one number were to be shared for all four interrupt signals, then the one resulting interrupt service routine would be slowed down by the need to determine the source of the interrupt. This disadvantage would defeat the aim of having faster interrupt handling by using four separate interrupt request signals. Four exception vector registers could be implemented using additional hardware (say in an FPGA), but this would be a relatively complicated solution. The new hardware would need to monitor the system bus so that it would step in and supply the appropriate exception vector number on the data bus whenever the CPU was in the middle of an interrupt acknowledgement cycle caused by one of the four DUART interrupts. With such registers implemented in the system, it would be possible to have four separate user interrupts and fast response using four separate interrupt service routines.
[15 marks]
DUART_ISR: MOVEM.L D0-D7/A0-A6,(SP)- DUART_ISR: MOVEM.L D0-D7/A0-A6,-(SP) /* predecrement */ LEA.L #DUART_ADDR,A0 LEA.L DUART_ADDR,A0 /* no # in LEA */ MOVE.B ISR(A0),D0 MOVE.B ISR(A0),D0 MOVE.B D0,D2 /* save copy of ISR*/ ANDI.B #RxRDYA,D0 ANDI.B #RxRDY,D0 BNE CheckTx BEQ CheckTx /* EQ, not NE */ RxIRQ: MOVE.W RBA(A1),D1 RxIRQ: MOVE.B RBA(A0),D1 /* A0, not A1 */ MOVE.W D1,-(A7) MOVE.W D1,-(A7) JSR ADD_TO_RX_QUEUE JSR ADD_TO_RX_QUEUE ADDQ.W #1,SP ADDQ.L #2,SP /* .L add and #2 data size */ BRA EXIT_ISR BRA EXIT_ISR CheckTx: ANDI.B #TxRDYB,D0 CheckTx: ANDI.B #TxRDYB,D2 /* use copy of the ISR */ BEQ EXIT_ISR BEQ EXIT_ISR TST.B ANY_BYTES_TO_TX TST.B ANY_BYTES_TO_TX BEQ DISABLE_TX_IRQS BEQ DISABLE_TX_IRQS LEA.L TX_BYTE_PTR,(A2) LEA.L TX_BYTE_PTR,A2 /* omit the brackets around A2 */ MOVE.B (A2)+,TBA(A0) MOVE.B (A2)+,TBA(A0) DISABLE_TX_IRQS: DISABLE_TX_IRQS: MOVE.B #TxRDYA,D3 /* create correct bit mask for ISR */ NOT.B D3 AND.B D3,IMR_COPY /* update copy of ISR */ MOVE.B TxRDYA,IMR(A0) MOVE.B IMR_COPY,IMR(A0) EXIT_ISR: MOVEM.L (SP)+,D0-D7/A1-A6 EXIT_ISR: MOVEM.L (SP)+,D0-D7/A0-A6 /* A0, not A1 */ RTS RTE /* RTE from ISRs, not RTS */
[15 marks]
The second problem is easily solved by modifying the appropriate numbers
in the constraint as follows:
Let T1 be the period of the transmitter clock and let T2 be the
period of a slightly fast receiver clock. We then have the
following constraint:
The right side gives the time interval that the receiver believes
is exactly 100 bit times, from the exact middle of the start bit to the
exact middle of the 100th data bit.
The left side gives the same time interval in terms of T1, where
the last data bit is sampled at the earliest allowed instant, namely,
25% of a bit time (4 clock periods of T1) too early.
Solving for T2/T1 we get 0.9975. The two clock frequencies
can therefore differ by up to (1/0.9975) - 1.0 = 1.00251 - 1.0 = 0.251%.
Very close to the same percentage is obtained if the receiver clock is
assumed to be slightly slow.
Here T2/T1 = 0.999167, so the two frequencies can differ by up
to (1/0.999167) - 1.0 = 1.000834 - 1.0 = 0.0834%.
Note that the two frequencies must agree more closely with each other
than before.
[10 marks]
If reception gets poor in a human-to-human telephone call, one of
the parties will either (a) hang-up immmediately and then redial, hoping
to get a cleaner connection, or (b) talk more loudly hoping to be more clearly
heard over the noise on the line.
It is possible to have problems due to the informality of this protocol for handling errrors. Both parties could hang up and wait for the other to dial first. This could cause an unnecessarily long delay until the call was resumed when one party's redial attempts was successful.
It is also possible that both parties could redial at exactly the same time, in which case it is possible that both call attempts will be blocked and both parties will hear a busy signal. However, eventually one of the repeated redial attempts by one party will succeed in getting through to the other party.
[10 marks]
Primary advantage:
Layering is used to manage the complexity of communications interfaces.
Each resulting layer is, by itself, easier to specify, design,
verify and modify than the entire interface would be if treated as one unit.
Other advantages:
Possible disadvantages of having too many layers: Each layer in a communications interface will introduce some overhead that appears in several forms: (1) In the specification of the interface, each new layer adds a new set of services and a new interlayer interface that must be specified correctly. This work will have to be negotiated in the standards committees and this effort will cost time and money. (2) Each new implementation of the communications interface will have to be verified for compliance with the specification of the protocols in all layers. This requirement adds complexity to the protocol conformance testers and adds expense to the process of certifying compliance of each new product implementation of the interface. Having more layers in the interface thus tends to make the verification problem more expensive. (3) Overhead in the form of extra processing time and extra storage space is generally required when passing information from layer to layer. Thus adding a new layer will tend to add some extra processing and storage cost.
[15 marks]
A router is used to interface two networks at layers 1, 2 and 3.
The two networks may be using different network layer (ISO layer 3) protocols,
so a router has to have the intelligence to be able to look into the packets
to: (1) adjust routing information if necessary, and (2)
adjust layer 1, 2 and/or 3 packet formatting if necessary.
Acting at layer 2, a router can make packet forwarding decisions based
on the packet addresses.
And acting at layer 1, a router can strengthen or refresh the signals.
A bridge is used to interface two networks at layers 1 and 2. Intelligence may be used in the bridge to filter the packets based on information in the packet headers (e.g. address information). For this reason, bridges are widely used to isolate packet traffic in different subsegments of a network. Acting at layer 1, a bridge can strengthen or refresh the signals.
A repeater is used to interface two networks at layer 1. The physical medium in the two networks can differ, but the bit-level structure of the packets cannot be changed by the repeater. Thus the bits are simply transferred from one network to the other network with no intelligent data processing. The repeater can amplify the signal to offset signal attenuation and/or can convert the signal between two different transmission media or signalling levels. A hub is a repeater that is used to form a star-shaped network topology.
In slide 7-16, routers are shown in two positions: (1) between the FDDI campus backbone and (2) between an Ethernet branch and an Appletalk network. In these positions, the routers can make any necessary address and packet format adjustments (between Ethernet and Appletalk) to transitting packets. Also the signal levels can be adjusted and/or strengthened.
The bridges are used in the network to isolate different Ethernet segments from the main departmental Ethernet backbone. In this way, traffic can be filtered by the bridges to avoid unnecessary traffic propagation and to reinforce security (packets can be kept out or maintained within selected Ethernet segments)
A conventional repeater is used in one Ethernet segment to extend its length. The repeater is being used here to strengthen the signals. The hub repeater is used at the end of a second Ethernet segment to create a star topology. This is done frequently so that cheaper twisted pair cabling can be used in each segment of the star (instead of conventional more expensive shielded Ethernet cable).
Briefly explain how the window scheme provides both features (1) and (2) mentioned at the start of this question.
[15 marks]
Flow control is provided because the receiving node can stop
the further arrival of packets from a sending node by freezing the
acknowledgement number that is including in the TCP header of packets
heading in the opposite direction.
Data packet loss and mis-ordering are detected at the receiver using the sequence number in the TCP header. The acknowledgement numbers should be strictly increasing (ignoring eventual wrap-around) in a sequence of packets that are in the correct order. Also, the number of bytes present in each new packet (TCP segment) should correspond to the increase in the sequence number from the last packet that was received. If one of these constraints is violated, the acknowledgement number in the reverse direction can be frozen, causing the sender to eventually resend the missing or out-of-order packets.