电信与网络 [英] Telecommunication and networks

查看:61
本文介绍了电信与网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您需要为称为USIUnet的简单数据链路层协议实现接收器.您的接收器将通过标准输入接收来自发送器的帧-输入的每一行都构成一个帧.您发送的每个帧都应在标准输出上作为一行提供.

USIUnet的帧格式如下:



目的地
目标地址(4个字节)
来源
源地址(4个字节)
标记(F)
标志-0 =数据,1 = ACK,2 = NAK(1字节)
序列号(SN)
当前帧的序列号(1字节)
类型
封装的网络层流量的类型(2个字节)-使用的值遵循DIXv2标准,因此为0x0800
数据
帧有效负载(可变长度-18到500字节)
CRC
前一帧的CRC-CCITT 16位校验和(2个字节)

必填:
(a)将自己分成三个学生一组.每个小组将处理一个项目;
b)通过编写需要处理到达帧的程序来实现接收器,如下所示:
1.仅当目标地址是您的地址或广播地址时,才处理该帧.就本作业而言,您的地址是您的8位学生编号,被视为4字节的十六进制值-即. 11223344被视为0x11223344.广播地址是所有位均为1(即0xffffffff)的地址.
2.如果要处理框架,则首先需要重新计算并验证校验和.如果校验和无效,则需要使用适当的NAK(否定确认)帧进行响应.
3.如果校验和有效,则需要检查标志字段的值以确定适当的响应.由于您仅实现接收器,因此您应该仅响应数据帧.
4.收到有效的数据帧后,您需要使用适当的确认帧进行响应.
您可以使用选择的任何编程语言,前提是您的代码可以在Lab2或Software Lab中的PC上运行.该项目中最具挑战性的部分可能是实现CRC-CCITT 16位校验和算法,您在选择工具时可能要考虑这一点.此校验和的多项式为0x1021(或X ^ 16 + X ^ 12 + X ^ 5 +1),并且CRC的初始值应为0xFFFF.

[edit]已删除喊话"-OriginalGriff [/edit]

You are required to implement the receiver for a simple data link layer protocol known as USIUnet. Your receiver will receive frames from the sender via standard input - each line of input constitutes a single frame. Each frame you send should be provided as a single line on standard output.

The frame format for USIUnet is as follows:



Destination
Destination address (4 bytes)
Source
Source address (4 bytes)
Flag (F)
Flags - 0 = Data, 1 = ACK, 2 = NAK (1 byte)
Sequence Number (SN)
Sequence number of current frame (1 byte)
Type
Type of encapsulated network layer traffic (2 bytes) - the values used follow the DIXv2 standard, hence 0x0800
Data
Frame payload (variable length - 18 to 500 bytes)
CRC
A CRC-CCITT 16 bit checksum of the preceding frame (2 bytes)

Required:
(a) Divide yourselves into groups of three students each. Each group will handle one project;
b) Implement a receiver by writing a program that needs to process arriving frames as follows:
1. Only process the frame if the destination address is either your address or the broadcast address. For the purposes of this assignment, your address is your 8 digit student number treated as a 4 byte hexadecimal value - ie. 11223344 is treated as 0x11223344. The broadcast address is the address where all bits are 1''s (ie. 0xffffffff).
2. If you are to process the frame, you first need to recalculate and validate the checksum. If the checksum is invalid then you need to respond with an appropriate NAK (negative acknowledgement) frame.
3. If the checksum is valid then you need to check the value of the flag field in order to determine an appropriate response. Since you are only implementing a receiver, you should only respond to data frames.
4. When you have received a valid data frame you need to respond with an appropriate acknowledgment frame.
You may use any programming language you choose, providing that your code can be run on a the PCs in Lab2 or Software Lab. Probably the most challenging part of this project will be implementing the CRC-CCITT 16-bit checksum algorithm and you might want to consider this when selecting your tools. The polynomial for this checksum is 0x1021 (or X^16 + X^12 + X^5 + 1) and the initial value of the CRC should be 0xFFFF.

[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案

如果您要张贴作业,请至少尝试使其看起来像您尝试做的那样自己动手吧!

我们不做您的作业:这是有原因的.在这里,您可以考虑自己被告知的内容,并尝试理解它.也可以在那里帮助您的导师识别您的弱点,并将更多的注意力放在补救措施上.

自己尝试,或学习魔语:您要用它炸薯条吗?"
If you are going to post your homework, at least try to make it look like you have attempted to do something yourself!

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, or learn the Magic Words: "Do you want fries with that?"


这篇关于电信与网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆