国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫CSEN 331、代做 C++程序語言

時間:2024-03-16  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



Programming Assignment CSEN 331 Wireless & Mobile Networks
General Guidelines
➢ Programming projects are individual assignments; each student should write his/her own code.
➢ This assignment should be written only in C programing language.
➢ Each project requires a demo, during which the student should explain how the code
works.
➢ Demos are part of the grade. The student will only receive full credit if the demo has proper results.
➢ In addition to the demo, each student should submit the source code, input/output files, and a README.txt file containing instructions on how to compile and run your source code.
➢ The program should be turned in on or before the deadline; demo must be performed on or before the deadline but after the program files have been turned in.
➢ Here are a couple of useful links to point you to the right direction for an Introduction to Socket Programming
http://beej.us/guide/bgnet/
https://www.youtube.com/watch?v=Emuw71lozdA
1. Client using UDP protocol for sending information to the Access Point (AP)
One client connects to one Access point.
The frame is recognized in UDP payload by two fields which contain identifiers:
Start of frame identifier .... 0XFFFF End of frame identifier ..... 0XFFFF
After the start of frame, the IEEE 802.11 frame is included and then the End of frame identifier will be attached, see Fig.1 in chapter 1.3.
For the FCS (Frame Check Sequence) calculation use the following function which will output FCS result for each frame sent by AP (Access Point) or client, see section 1.2.
     CSEN 331 Programming Assignment
1

 1.1 Operation:
a) Transmit:
For each frame which is transmitted by client or AP (Access Point) the FCS should be calculated
based on the function in chapter 1.2, and then in the FCS field of IEEE 802.11 frame inserted, the whole IEEE 802.11 frame will be included in the UDP payload field.
The client should start an ack_timer at the time the frame is sent to the AP (Access Point)), if the response related to request message (See below the list of expected response messages from AP) for each frame has not been received during ack_timer period by client before expiration of timer, then client should retransmit the frame that was sent before and restart the timer.
The timer can be set at 3 seconds (recommended) and a retry counter should be used for resending the frame. If the response for the frame does not arrive before the timeout, the client will retransmit the frame and restart the ack_timer, and the ack_timer should be reset for a total of 3 times.
If no response was received from the server after resending the same frame 3 times, the client should generate the following message and display on the screen,
“Access Point does not respond”.
b) Receive:
For each frame which is Received by client or AP (Access Point) the FCS should be re-calculated and compared with the FCS received field of IEEE 802.11 frame, if it is correct then the received frame will be accepted and according to the request message the response will be generated and sent to the client, else should AP generate an error message and display on the screen.
Note: For all frame exchanges between mobile client/AP and between AP/mobile client should use Checksum verification for transmitted and received frames (function in chapter 1.2).
List of request/response messages
The table 1 contains the list of messages:
       Client
 Access Point
   Association Request Probe Request
RTS (Request To Send) Data
Association Response Probe Response
CTS (Clear To Send) ACK (Acknowledge)
         Error Message, to be generated when no proper response for each frame after 3 times timer expires.
    Table 1. List of request/response messages
CSEN 331 Programming Assignment
2

1.2. Checksum function for calculation of transmitted and received frames:
The following function for frame checksum calculation will be used, you will include this function in your code.
This FCS calculation function should be added in your code: #include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h> #include <unistd.h>
/*
* Takes in an input string and generates a **-bit checksum hash value of type uint**_t
* This function is internally called by the function getCheckSumValue(); so not to be called directly by
developer
* Input type: String
* Output type: uint**_t */
uint**_t generate**bitChecksum(const char* valueToConvert) { uint**_t checksum = 0;
while (*valueToConvert) {
checksum += *valueToConvert++; checksum += (checksum << 10); checksum ^= (checksum >> 6);
}
checksum += (checksum << 3); checksum ^= (checksum >> 11); checksum += (checksum << 15); return checksum;
}
/*
* This function can be called by the developer to generate a **-bit checksum directly from the pointer to your
frame structure
* The function is independent of the contents/data types used in your frame structure
* It works based on the bits in your structure
* IMPORTANT NOTE & Hint: For accurate results, you must use __attribute__((packed)) while creating your
Frame structure
* to avoid additional padding bytes which occur in C language structures
* Input: Pointer to the frame structure, the size of the frame structure, number of bytes to skip from the start
and end (for crc calculation)
* Providing example input for reference: uint**_t checksum = getCheckSumValue(&yourFrame,
sizeof(yourFrame), bytesToSkipFromStart, bytesToSkipFromEnd)
* Hint: bytesToSkipFromEnd is provided (for instance) since the CRC computation should not include the FCS
field of the payload
* Output: uint ** bit final Check Sum value */
uint**_t getCheckSumValue(const void *ptr, size_t size, ssize_t bytesToSkipFromStart, size_t bytesToSkipFromEnd) {
const unsigned char *byte = (const unsigned char *)ptr;
// binaryString[] is a logical representation of 1 byte. Each character in it represents 1 bit.
// Do not confuse with the size of character in C language (which is 1 byte). This is just a representation. char binaryString[9]; // One additional character for the null terminator
binaryString[8] = '\0'; // Null terminator definition
  CSEN 331 Programming Assignment
3

char *buffer = malloc(1); // Allocates space for an empty string (1 byte for the null terminator) buffer[0] = '\0'; // Initializes an empty string
for (size_t i = 1; i <= size; i++) { for (int j = 7; j >= 0; j--) {
int bit = (byte[i - 1] >> j) & 1;
binaryString[7 - j] = bit + '0'; // Converts bit to character '0' or '1' }
buffer = realloc (buffer, strlen(buffer) + strlen(binaryString) + 1); // Resizes buffer to fit the concatenated result
strcat(buffer, binaryString); }
buffer[strlen(buffer)-(bytesToSkipFromEnd*8)] = '\0';
memmove(buffer, buffer + (bytesToSkipFromStart*8), strlen(buffer) - (bytesToSkipFromStart*8) + 1); //+1 for null terminator
// printf("\nGenerated string: %s\n", buffer);
// printf("\nSize of generated string in bytes: %zu\n", strlen(buffer)/8);
uint**_t checkSumValue = generate**bitChecksum(buffer). free(buffer); // Freeing memory allocated by malloc.
return checkSumValue;
}
CSEN 331 Programming Assignment
4

1.3 Frame Format:
UDP Payload which will contain IEEE 802.11 frame:
Bytes: 2 2346 (Maximum) 2
   Start of Frame ID
 Payload
 End of Frame ID
    Bytes2 2 6 6 6 2 6 0-2312 4
Bit 0 Bit 15
bits2 2 4 1 1 1 1 1 1 1 1
Figure 1: UDP Payload which will contain IEEE 802.11 frame
 Frame Control
 Duration ID
 Address 1
 Address 2
 Address 3
 Sequence Control
 Address 4
 Pay load
 FCS
   Protocol version
 Type
 Sub type
 To DS
 From DS
 More Frags
 Retry
   Power More
WEP ManaIgEemEeEn 80D2a.1ta1 frame.
t
 order
   CSEN 331 Programming Assignment
5

1.4 Procedure:
Initially client and server will set the following fields based on frame type and sub-type:
Set Protocol version: Current protocol version is 0. More Fragment: 0
Retry: Disabled
Power management: Disabled
More Data: 0
WEP: 0
Order: 0
Sequence Control: 0000
Address 4: Bridge address set to 000000000000
To DS and From DS fields: Set these fields for each frame you send properly:
• Data From client to AP
ToDS, To AP (Infrastructure Network) =1
From DS, From AP (Infrastructure Network) =0
• From AP to client:
ToDS, To AP (Infrastructure Network) =0
From DS, From AP (Infrastructure Network) =1
FCS (Frame Check Sequence): use the function mentioned in chapter 1.2. All the above fields should be set properly for each frame type and sub
type.
1. Client sends Association Request:
Set properly the fields for IEEE 802.11 frame in chapter 1.3. AP will fill in the sub type properly.
Set type = 00
Set sub type = 0000
Set Duration ID =0
Address 1 field: Final receiver address MAC address (example: AABBCCDDEEDD)
Address 2: Originator Address, (example:1245CCDDEE88) Address 3: Access point address (example: AABBCCDDEEDD)
Client will calculate FCS (Frame Check Sequence) using the FCS function in chapter 1.2.
    CSEN 331 Programming Assignment
6

2. AP (Access Point) sends Association Response to Client:
Recalculate FCS (Frame Check Sequence) using the FCS function in chapter 1.2.
The received AP compares recalculated and received FCS values, if they are equal then will proceed with the following steps:
AP will set the subtype properly.
Set type = 00
Set sub type = 0001
Set Duration ID =XXXX <<< set any two Bytes Hex value to the user, this will be the association ID
Address 1 field: Final receiver address MAC address (example: 1245CCDDEE88) Address 2: Originator address, is AP (example: AABBCCDDEEDD)
Address 3: Access Point address (example: AABBCCDDEEDD)
All fields should be set properly.
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
Calculate for this new frame the FCS (Frame Check Sequence) using the FCS function in chapter 1.2.
3. Client sends Probe Request:
Client will fill in the type and sub type properly. Set type = 00
Set sub type = 0100
Set Duration ID =0
Address 1 field: Final receiver address MAC address (example: AABBCCDDEEDD) Address 2: Originator Address, AP (Access point address)
(example: 1245CCDDEE88)
Address 3: Access point address (example: AABBCCDDEEDD)
The client will fill in the Address 2 field with its own MAC address.
Set properly the fields for IEEE 802.11 frame in chapter 1.4. FCS (Frame Check Sequence): use the FCS function in chapter 1.2.
4. AP (Access Point) Response sends Probe Response to Client:
Prior to sending response the AP will recalculate the FCS of the received Probe Request frame by using the FCS function in chapter 1.2.
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
Set Duration ID =XXXX <<< set any two Bytes Hex value to the user, this will be the association ID
The received AP compares recalculated and received FCS values, if they are equal then will proceed with the following steps:
Set properly the fields for IEEE 802.11 frame in chapter 1.3.
Address 1 field: Final receiver address MAC address (example: 1245CCDDEE88) Address 2: Originator Address, AP (Access point address)
   CSEN 331 Programming Assignment
7

(example: AABBCCDDEEDD)
Address 3: Access point address (example: AABBCCDDEEDD)
FCS (Frame Check Sequence): use the FCS function in chapter 1.2.
5. Client sends RTS:
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
Address 1 field: Final receiver address MAC address (example: AABBCCDDEEDD) Address 2: Originator Address, (example:1245CCDDEE88)
Address 3: Access point address (example: AABBCCDDEEDD)
Set type =01
Set sub type= 1011
Set Duration ID =4
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
Calculate for this new frame the FCS (Frame Check Sequence) using the FCS function in chapter 1.2.
6. AP (Access Point) sends CTS Response to Client:
Recalculate received FCS (Frame Check Sequence) using the FCS function in chapter 1.2. The received AP compares recalculated and received FCS values, if they are equal then will proceed with the following steps to prepare the frame.
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
Address 1 field: Final receiver address MAC address (example: 1245CCDDEE88) Address 2: Originator address, is AP (example: AABBCCDDEEDD)
Address 3: Access Point address (example: AABBCCDDEEDD)
Set Type = 01
Set Sub Type = 1100
Set Duration ID =3
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
Calculate for this new frame the FCS (Frame Check Sequence) using the FCS function in chapter 1.2.
7. Client sends one Data Frame:
The received client compares recalculated and received FCS values, if they are equal then will proceed with the following steps:
Address 1 field: Final receiver address MAC address (example: AABBCCDDEEDD) Address 2: Originator Address, (example:1245CCDDEE88)
Address 3: Access point address (example: AABBCCDDEEDD) Set Type = 10
Set Sub Type = 0000
Set Duration ID =2
The 802.11 payload can be any hex value the maximum length is 2312 Bytes, if less than this value fills in the rest with 0XFF.
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
      CSEN 331 Programming Assignment
8

Calculate for this new frame the FCS (Frame Check Sequence) using the FCS function in chapter 1.2.
8. AP (Access Point) sends ACK to Client:
Recalculate FCS (Frame Check Sequence) using the FCS function in chapter 1.2. to calculate FCS.
The received AP compares recalculated and received FCS values, if they are equal then will proceed with the following steps to send ACK:
Address 1 field: Final receiver address MAC address (example: 1245CCDDEE88) Address 2: Originator address, is AP (example: AABBCCDDEEDD)
Address 3: Access Point address (example: AABBCCDDEEDD)
Set Type = 01
Set Sub Type = 1101
Set Duration ID =1
Set properly the fields for IEEE 802.11 frame in chapter 1.4.
Calculate for this new frame the FCS (Frame Check Sequence) using the FCS function in chapter 1.2.
++++++++++++++++++++++++++++++++++++++++++++++++ 9. FCS Error handling:
NOTE: After successful transmission of data frame which client sends and receive of ACK (Above items 7 and 8), the client should generate a frame with wrong
checksum, filling FCS field with some data which is not calculated by FCS (Frame Check Sequence) function in chapter 1.2.
The AP (Access Point) should generate an error message for FCS (Frame Check Sequence) error after recalculation of checksum which recognizes this value is not equal to the received FCS (Frame Check Sequence).
AP (Access Point) generates the error message “FCS (Frame Check Sequence) Error” and displays on the screen.
      ***************************************************
10. Sending Multiple Frame Procedure:
Client sends five fragmented frames (Frame 1, 2, 3, 4, 5) which are fragments of a file to the AP.
Prior client sending the 5 frames, send one time the RTS frame with Duration ID =12, AP response CTS with Duration ID =11 (This procedure will allocate time for the 5 frames and ACKs transmissions)
For each DATA frame sent from client Duration ID will be decremented, and for each frame sent from AP Duration ID will be decremented.
The AP acknowledges with ACK frame the correct frame received from client by sending five ACK frames.
Set the parameters in IEEE 802.11 header properly for client and AP (see chapter 7 and 8) in addition you need to set the more fragment bit properly.
          CSEN 331 Programming Assignment
9

The client then sends another five fragmented frames (Frame 1, 2, 3, 4, 5) to the AP, emulating one correct frame and four frames with errors.
The server acknowledges with ACK each correct frame sent from client, and with corresponding error message displayed on the screen “No ACK Received for Frame No.X” for the frames with errors (Total of four error message).
The client will start an ack_timer at the time each frame is sent to AP, if the ACK frmae for each frame has not been received during ack_timer period by client before expiration of timer then client should retransmit again the frame that was sent before.
The timer can be set at 3 seconds (recommended) and a retry_ack_counter should be used for resending the frame. If the ACK for the frame does not arrive before the ack_timer times out, the client will retransmit the frame and restart the ack_timer, and the ack_timer should be reset for a total of 3 times (retry_ack_counter = 3).
If no ACK is received from the AP after resending the same frame 3 times, the client should generate the following message and display on the screen:
“No ACK received from AP”.
Error handling:
NOTE: All four error handling messages should be simulated and displayed on the screen, the error response messages should be included in a (.pdf, .png, .jpg) file and turned in with your source code.
  CSEN 331 Programming Assignment
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:ME1014代做、代寫 Matlab 程序設(shè)計(jì)
  • 下一篇:CS101 編程代寫、代做 java程序語言
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手,多多出評軟件徽y1698861
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    免费av一区二区| 欧美最大成人综合网| 亚洲一区二区自拍| 日产国产精品精品a∨| 国产伦精品一区二区三区免费视频| 91国自产精品中文字幕亚洲| 国产精品成人久久久久| 日本精品久久久| 久久婷婷开心| 亚洲a∨一区二区三区| 成年人网站国产| 欧美精品在线免费观看| 激情视频综合网| 国产精品丝袜高跟| 欧美亚洲另类激情另类| 国产成人a亚洲精v品无码| 亚洲v日韩v欧美v综合| 国产亚洲精品自在久久| 国产精品无码人妻一区二区在线| 日韩av电影国产| 成人av在线天堂| 欧美在线国产精品| av资源站久久亚洲| 亚洲欧洲三级| 国产精品12p| 中文字幕综合在线观看| av无码久久久久久不卡网站| 亚洲中文字幕无码一区二区三区| 97人人干人人| 日韩av电影在线免费播放| 久久国产手机看片| 欧美在线观看黄| 国产精品美女久久久久久免费| 青青在线免费观看| 国产精品视频不卡| 精品视频在线观看一区二区| 不卡毛片在线看| 国产美女视频免费| 亚洲一区中文字幕| 91免费看蜜桃| 日本一欧美一欧美一亚洲视频| 日韩精品在线中文字幕| 国产精品无码免费专区午夜| 国产日韩三区| 午夜一区二区三区| 久久久久久久久久久久久久久久av| 欧美在线精品免播放器视频| 国产精品福利无圣光在线一区| 国产一区二区三区乱码| 精品国产一区二区三区久久久久久 | 成人亚洲综合色就1024| 亚洲一区二区免费| 久久riav| 麻豆精品传媒视频| 亚洲一区二区在线| 精品国模在线视频| 国产乱子伦精品| 天天综合色天天综合色hd| 久久99久久精品国产| 国产在线视频91| 亚欧洲精品在线视频免费观看| 日韩中文视频免费在线观看| 国产乱码一区| 欧洲国产精品| 欧美激情伊人电影| www.日韩.com| 97久久精品人人澡人人爽缅北| 欧美在线免费视频| 自拍视频一区二区三区| 久久国产精品-国产精品| 国产淫片免费看| 亚洲一区二区三区午夜| 国产成人久久精品| aaa级精品久久久国产片| 欧美在线免费视频| 亚洲爆乳无码专区| 国产精品国内视频| 久久久噜噜噜久噜久久| 国产欧美日韩最新| 日韩亚洲欧美精品| 自拍日韩亚洲一区在线| 精品国产自在精品国产浪潮| 国产麻豆乱码精品一区二区三区| 日本一区二区三区四区高清视频| 欧美猛少妇色xxxxx| 久久久久久久有限公司| 成人国产一区二区三区| 欧美在线亚洲一区| 欧美一区二区三区图| 久久国产精品网站| 日韩一区二区久久久| 97色在线播放视频| 国产欧美日韩91| 日本精品久久久| 一区二区三区欧美成人| 国产成人无码a区在线观看视频 | 国产精品无码专区在线观看| 国产大片精品免费永久看nba| 国产一区二区在线视频播放| 欧美最猛性xxxxx亚洲精品| 亚洲精品一区二区三区樱花| 国产精品久久久久久久久久久久久久 | 国产精品国模在线| 久久99精品久久久久久三级| 成人a视频在线观看| 国产呦系列欧美呦日韩呦| 欧美亚州一区二区三区| 日韩欧美一区三区| 天堂v在线视频| 亚洲乱码一区二区三区三上悠亚| 精品自拍视频在线观看| 国产精品极品美女在线观看免费| 精品国产一区二区三区四区在线观看 | 精品国产日本| 久久伊人色综合| 国产精品嫩草在线观看| 国产成人高清激情视频在线观看| 91九色视频在线| 99久久自偷自偷国产精品不卡 | 久久久婷婷一区二区三区不卡| 99久热re在线精品996热视频| 国产欧美高清在线| 国产裸体写真av一区二区| 国产乱子伦精品视频| 国产欧美一区二区三区四区| 国产日韩一区二区在线观看| 国产又粗又猛又爽又黄的网站| 国产主播精品在线| 国产三级精品网站| 国产精品一区二区三区久久| 国产乱人伦真实精品视频| 国产精品一二三在线观看| 成人av播放| 91高潮在线观看| 国产夫妻自拍一区| 久久久久久久久久久久久9999 | 日本一区免费在线观看| 日日摸日日碰夜夜爽av| 日本三级中国三级99人妇网站| 日本精品久久久久中文字幕| 欧美一级大片视频| 欧美日韩一区二区三区在线视频 | 国产在线精品一区免费香蕉| 国产天堂在线播放| av观看免费在线| 久久男人av资源网站| 日韩中文字幕在线观看| 国产精品涩涩涩视频网站| 国产精品久久一区| 久久久久久国产精品美女| 亚洲一区二区三区777| 日韩最新中文字幕| 欧美黄网在线观看| 国产一二三区在线播放| 成人国产精品av| 国产成+人+综合+亚洲欧洲| 久久久国产精品一区| 精品中文字幕在线| 亚洲精品日产aⅴ| 日韩免费在线播放| 好吊色欧美一区二区三区四区| 国产欧美精品一区二区| 国产成人综合av| 国产精品久久一区主播| 亚洲国产精品123| 日本一区网站| 国产在线精品91| 久久综合九九| 久久av在线播放| 午夜精品一区二区三区在线视| 日韩区国产区| 国产精品自拍网| 久久久久久久久影视| 精品国产一二| 日韩久久久久久久| 国产精品夜夜夜一区二区三区尤| 久久久久久久网站| 一区二区视频在线播放| 日本wwwcom| 成人h在线播放| 北条麻妃久久精品| 亚洲在线一区二区| 欧美一区二区影视| 2019日本中文字幕| 欧美成在线观看| 欧美中文字幕第一页| aaa级精品久久久国产片| 国产精品美女视频网站| 日本午夜在线亚洲.国产| 国产日韩欧美大片| 久久综合色一本| 久久久久国产精品www| 欧美 日韩 国产 激情| 97久久伊人激情网| 欧美成年人视频网站| 日韩成人在线资源| 成人免费在线网| 国产精品久久久久影院日本| 日本少妇高潮喷水视频| 97干在线视频|