C LANGUAGE
linux
network programming
Authors: WhoAmI, CrazyMonkey
email: kccddb@gmail.com
Date: 20221217
Copyright: CC BY-NC-SA
Do your best to be ethical and respect copyright.
這裡的內容 適合 資電大三以上 學過網路, Linux 與 c 語言的人士
開始練習 看 man page 與 良好的程式設計習慣, 例如 MT-Safe(Multi Thread Safe), data type (資料型態)…等
至於 效能 請 學好 Probability, Statistics, OS and Algorithm 等
c Language:
ANSI C for Programmers on UNIX Systems, Tim Love
putty or MobaXterm
Ubuntu-16.04, VirtualBox
Win32 Editor: Komodo Edit
Learn iproute2
ip addr
ip route
Learn commands:
vim, nano, wget, sudo, cd, ls, cp, cat, more, find, ln, grep, ps, chmod, chown, tar, mkdir, rm, rmdir, df, du, kill, echo, ping, strace, top, strip, route, ifconfig, arp, pstree, touch, netstat, ldd, pstree, objdump, gunzip, gzip, bzip2, dmesg, pwd, which, iptables, brctl, iproute2 ip command …
其實我自己較 "懶" shell commands 自己學(其實 也沒時間教)
資電的練習 看 8051 datasheet, 培養 看 datasheet 的習慣
Learn How to Use Wireshark like a PRO
過去我自己的教學慣例: 期末作業是傳4G 的檔案, 要處理 網路斷線多次 (斷電, 拔網路線, 蓋金屬盒子, NMAP 等…), 頻寬不同 並可續傳的 client/server, 事實上實作 不容易, 但學生可以體會很多實務上的問題
注意 傳檔案大小時, 注意 byte order 的問題 ( client/server 會遇到 不同 byte order 問題)
很多 用 ping xx.xx.xx.xx 偵測網路通不通~真的完整嗎? Why? (這問題 對 非通訊電子了解的人士 算難)
ping 可以, 但有時使用不行, 或不穩定
Hint: noise,interference, 接觸不良, …
使用 Netstat 指令檢測網路的技巧, by G. T. Wang
7-Zip
網路程式會動很容易, 穩定與效能才是重點
個人 覺得 網路程式設計
最好 星期六 日
10:00~12:00 13:00~16:00
3~4 星期 結束, 可惜 學校不是 如此
學校也可收業界的人士~死腦筋
COURSE OUTLINE
有意修習 (或未來)embedded system 課的同學
Learn commands: (請看 man page)
vim, nano, wget, sudo, cd, ls, cp, cat, more, find, ln, grep, ps, chmod, chown, tar, mkdir, rm, rmdir, df, du, kill, echo, man, top, ping, which, touch, pstree, strace, strip, netstat, lsmod, insmod, rmmod, modinfo, bzip2, gunzip, tcpdump, mount, umount, dd, objdump, gzip, mke2fs, tee, tail, dmesg, reboot, sync, cpio, losetup, strip -g (Remove debugging symbols only), …
Linux 匹配文字 grep 指令用法教學與範例, by G. T. Wang
Nmap-the Network Mapper - Free Security Scanner
Nmap Network Scanning
The Official Nmap Project Guide to Network Discovery and Security Scanning
裡面 有 bzero , 請改用 memset, 可見是 前輩! 自己 SSL 有版權問題 不方便 公開免費使用
應用 例如 學校用 e-mail 認證( DNAT+POP3) Wifi 密碼
ssl server client programming using openssl in c
websocket Theldus/wsServer
以下比較適合 大四 研一