# Mạng máy tính ## Địa chỉ IP ### Classful ![image](https://hackmd.io/_uploads/rkVjV7aXT.png =x200) ![image](https://hackmd.io/_uploads/Hyl5azamT.png =x300) 0.0.0.0 Máy chủ sẽ lắng nghe trên tất cả các giao diện mạng mà máy tính đó kết nối đến (ví dụ: Ethernet, Wi-Fi). 127.0.0.1 chỉ có chính máy mình truy cập được. 192.0.0.1 Các thiết bị cùng mạng nội bộ kết nối được. 224 ![image](https://hackmd.io/_uploads/SyuVr7pQ6.png =x120)![image](https://hackmd.io/_uploads/BJLYHmT7T.png =x160) ![image](https://hackmd.io/_uploads/H1hkLmT7T.png =x120) ### Classless ![image](https://hackmd.io/_uploads/SyLjUQp76.png =x150)![image](https://hackmd.io/_uploads/BJtZD76m6.png =x150) ![image](https://hackmd.io/_uploads/HJE8wQa7p.png =x100) ### Chia subnet ![image](https://hackmd.io/_uploads/SkeAumpXp.png =x70) Chia dư: 16.0 => 0001 0000 . 0000 0000 = 4096 - 2 = 4094 máy mỗi subnet ![image](https://hackmd.io/_uploads/SkwEK76X6.png =x200)![image](https://hackmd.io/_uploads/HklFFQT7p.png =x150) ![image](https://hackmd.io/_uploads/BkvXj7p76.png =x70)![image](https://hackmd.io/_uploads/B14IoQ6mp.png =x140) Chia vừa đủ: Lấy đứa cao nhất 60 PC => 64 từ cụm 192.168.1.128 + 32 (30 PC) =192.168.1.160 --- ## Congestion control https://drive.google.com/drive/folders/183JRbukvL2OkTj1sSpeM418be9M7pahQ ### TCP retransmission ![image](https://hackmd.io/_uploads/ByeopmTQa.png) ### AMID ![image](https://hackmd.io/_uploads/rJI_RXaXa.png =x200) ### Tahoe and Reno ![image](https://hackmd.io/_uploads/rJho0mTQp.png =x200) Timeout (mạng quá tải reset lại từ đầu) 3 ACK feedback failed. (do đường truyền không ổn định giảm lưu lượng xuống) --- ## Agenda https://drive.google.com/drive/folders/183JRbukvL2OkTj1sSpeM418be9M7pahQ ### Scheduling Discipline (sắp xếp kỷ luật) **FIFO Queuing** ![image](https://hackmd.io/_uploads/Byp7kN6Qp.png =x300) ![image](https://hackmd.io/_uploads/HJCVJEp7p.png =x200) Xoay vòng lần lượt để các lowest priority không starve(đói). ![image](https://hackmd.io/_uploads/S1FDeVaQ6.png =x300) Đánh trọng số xoay vòng, xoay đến chỗ có trọng số cao sẽ dừng lâu hơn. ### Traffic Shaping Algorithms ![image](https://hackmd.io/_uploads/r1BgMNpXT.png =x150)![image](https://hackmd.io/_uploads/B1XGMVTXT.png =x230) ![image](https://hackmd.io/_uploads/HytcGVp76.png =x240)![image](https://hackmd.io/_uploads/HJskX4T7p.png =x270) ![image](https://hackmd.io/_uploads/ByOX746mp.png =x200) ### Qos (quanlity of service) ![image](https://hackmd.io/_uploads/Bkd_bNTXa.png =x200)![image](https://hackmd.io/_uploads/SJuiXVTXa.png =x200) Best effort: cố gắng gửi nhiều nhất. Integrated Services: tạo con đường riêng độc quyền. ![image](https://hackmd.io/_uploads/SJBCQNpQ6.png =x200) --- ## Routing Concepts https://drive.google.com/drive/folders/183JRbukvL2OkTj1sSpeM418be9M7pahQ ### Static routing ![image](https://hackmd.io/_uploads/BJk98fR76.png =x80) ![image](https://hackmd.io/_uploads/H1XxDGA76.png =x130)![image](https://hackmd.io/_uploads/r14UDMA76.png =x120) ![image](https://hackmd.io/_uploads/r1EKLG0X6.png) ### Dynamic routing ![image](https://hackmd.io/_uploads/r1bszXCXT.png =x400) ![image](https://hackmd.io/_uploads/rkc1m7RmT.png =x90) RIP: greedy Algorithms. OSPF: Dijkstra Algorithms. BGP cho internet (khác các nhà cung cấp dịch vụ). ## IPv6 thay các cụm 0000 bằng :: vd: 235:0:0:0:0:2:3:4 = 235::2:3:4 Nếu có 2 cụm 0000 thì thay phía có nhiều hơn. ### Chuyển đổi dần IPv4->6 ![image](https://hackmd.io/_uploads/SygiG2SBa.png =x300) Mở con đường riêng cho Ipv6 ![image](https://hackmd.io/_uploads/Bk6lznBHT.png =x300) nén ipv6 trong gói tin ipv4 tại router. ## Tham khảo https://drive.google.com/drive/folders/17VVtAzybAc3-nj43r-mYtkV-VDwFr_ZS